var count_slide_show = 0;
var current_slide_entry = 0;
var tab_slideshow = new Array();

function change_slideshow() {
	$('slideshowimg').src = '/_includes/framer.php?base=/images/slideshow_homepage/' 
						  + tab_slideshow[current_slide_entry]
						  + '&mask=217x108'
						  + '&just_resize=2';
	current_slide_entry = (current_slide_entry + 1) % count_slide_show;
}

function launch_slideshow() {
	setInterval('change_slideshow()', 5000);
}

function navbar_select(text) {
	document.getElementById('navbar_selected').innerHTML = text;
}

function disableSelection() {
	if (typeof document.body.onselectstart != "undefined") //IE route
		document.body.onselectstart = function() {return false}
	else if (typeof document.body.style.MozUserSelect != "undefined") //Firefox route
		document.body.style.MozUserSelect = "none";
	else //All other route (ie: Opera)
		document.body.onmousedown = function() {return false}
	document.body.style.cursor = "default";
}

var _hex2bin = [
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
	0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 0, 0, 0, 0, 0, // 0-9
	0,10,11,12,13,14,15, 0, 0, 0, 0, 0, 0, 0, 0, 0, // A-F
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
	0,10,11,12,13,14,15, 0, 0, 0, 0, 0, 0, 0, 0, 0, // a-f
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
];

function hex2bin(str) {
	var len = str.length;
	var rv = '';
	var i = 0;

	var c1;
	var c2;

	var charCode;
	
	while (len > 1) {
		h1 = str.charAt(i++);
		c1 = h1.charCodeAt(0);
		h2 = str.charAt(i++);
		c2 = h2.charCodeAt(0);
		
		charCode = (_hex2bin[c1] << 4) + _hex2bin[c2];
		switch (charCode) {
			case 146:
				rv += "'";
				break;
			
			case 150:
				rv += '&ndash;';
				break;
			
			default:
				rv += String.fromCharCode(charCode);
		}
		len -= 2;
	}

	return rv;
}

function deCrypt(mycontent) {
	var content = hex2bin(mycontent);
	document.write(content);
}

var message = "Copyright © SecEUR";

function clickIE4() {
	if (event.button == 2) {
		alert(message);
		return false;
	}
}

function clickNS4(e) {
	if (document.layers || document.getElementById && !document.all) {
		if (e.which == 2 || e.which == 3) {
			alert(message);
			return false;
		}
	}
}

if (document.layers) {
	document.captureEvents(Event.MOUSEDOWN);
	document.onmousedown=clickNS4;
} else if (document.all && !document.getElementById) {
	document.onmousedown=clickIE4;
}

document.oncontextmenu = new Function("alert(message);return false");

function check() {
	if (!$('uploadDragDropNotWorks')) {
		disableSelection();
	}
}

StkFunc(check);


