/*  Scitec Nutrition
    --------------------------------------------------------------
	Függvények:		JavaScript
	Készítette:		Egyed Krisztián	
    --------------------------------------------------------------
*/
var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if ( plugin ) {
	var words = navigator.plugins["Shockwave Flash"].description.split(" ");
   	for (var i = 0; i < words.length; ++i) {
		if (isNaN(parseInt(words[i])))
		continue;
		var MM_PluginVersion = words[i]; 
	}
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
	document.write('on error resume next \n');
	document.write('MM_FlashCanPlay = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('</SCR' + 'IPT\> \n');
}

function play_main() {
	var so = new SWFObject("page-data/ad/player.swf", "sotester", "296", "201", "8", "#000000");
	so.addVariable("flashVarText", "ad/video.flv");
	so.addParam("wmode", "transparent");
	so.write("main_video");

}

function disable_text(id) {
	var area = document.getElementById(id);
	disableSelection(area);
}

function disableSelection(target){
	if (typeof target.onselectstart!="undefined")
		target.onselectstart=function(){return false}
	else if (typeof target.style.MozUserSelect!="undefined")
		target.style.MozUserSelect="none"
	else
		target.onmousedown=function(){return false}
	target.style.cursor = "default"
}

function flash(name, width, height) {
	if ( MM_FlashCanPlay ) {
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'">');
		document.write('<param name="movie" value="'+name+'.swf">');
		document.write('<param name="quality" value="high">');
		document.write('<param name="WMODE" value="transparent">'); 
		document.write('<embed src="'+name+'.swf" width="'+width+'" height="'+height+' quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent"></embed></object>');
		document.write('</object>');
	} else{
		document.write('<img src="'+name+'.jpg" usemap="#script">');
	}
}

function home_kategoria(id, db) {
	if (id != -1) {
		if (document.getElementById('home_kategoria_akt-'+id).style.display == 'block') {
			document.getElementById('home_kategoria_akt-'+id).style.display = 'none';
		}
		else {
			for (k=0; k<db; k++) {
				document.getElementById('home_kategoria_akt-'+k).style.display = 'none';
			}
			document.getElementById('home_kategoria_akt-'+id).style.display='block';
		}
	}
}

function hover_in(id, num) {
	img_hover = eval(num + ".src");
	document.getElementById(id).src = img_hover;
}
function hover_out(id, name) {
	document.getElementById(id).src = name;
}
function play_youtube(link, loc){
	document.getElementById(loc).src = link;
	if (loc == "video_player") {
		document.getElementById(loc).style.height="474px";		
	}
}
function play_youtube_sub(link, loc){
	parent.document.getElementById(loc).src = link;
	if (loc == "video_player") {
		parent.document.getElementById(loc).style.height="474px";		
	}
}
function play_video(link, loc){
	document.getElementById(loc).src = link;
	document.getElementById(loc).style.height="657px";
}
function play_video_sub(link, loc){
	parent.document.getElementById(loc).src = link;
	if (loc == "video_player") {
		parent.document.getElementById(loc).style.height="657px";		
	}
}

function pagination(id, mode) {    
    if (mode == '1') {
        document.getElementById('bg_pagination_'+id+'1').style.display = 'none';
        document.getElementById('bg_pagination_'+id+'2').style.display = 'block';
    }
    else {
        document.getElementById('bg_pagination_'+id+'1').style.display = 'block';
        document.getElementById('bg_pagination_'+id+'2').style.display = 'none';  
    }
}

function border_in(id) {
	id.style.border = "#898e94 1px solid";
}
function border_out(id) {
	id.style.border = "#1e222d 1px solid";
}

function shareIt(url){
    var theWidth = 600;
	var theHeight = 450;
	var theTop=(screen.height/2)-(theHeight/2);
	var theLeft=(screen.width/2)-(theWidth/2);
	var features='height='+theHeight+',width='+theWidth+',top='+theTop+',left='+theLeft+""; 
	var name = new Date().getTime();
	var surl = 'http://www.facebook.com/sharer/sharer.php?u=' + url;
    
	reWin=window.open(surl,name,'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,height='+theHeight+',width='+theWidth+',top='+theTop+',left='+theLeft+'');	 
}
