$("document").ready( function() { 

	if($(".categoryBrowsingHolder").size() != 0) {

		$(".categoryGenericHolder .categoryGenericTop").hide();

	}

});




			function OnReadyStateChangeRegisterShopGenericLog()
			{
			}
			
			function RegisterSessionLog(){
				var ajax;
				if (window.XMLHttpRequest) 
					ajax = new XMLHttpRequest();
				else
					ajax = new ActiveXObject("Msxml2.XMLHTTP"); 
				ajax.onreadystatechange = OnReadyStateChangeRegisterShopGenericLog;	
				var sURL;
				var sQuery;
				sURL="/tools/register_shop_session_log.aspx";
				var d = new Date();
				var curr_msec = d.getMilliseconds()
				sQuery="rnd=" + curr_msec;
				ajax.open("POST", sURL, false);
				ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
				ajax.send(sQuery); 
				ajax = null;
			}
			
			
			

function OnReadyStateChangeRegisterShopGenericLog(){

}

function RegisterShopGenericLog(affiliate,shop,customer,type,code,p1,p2,p3){

var ajax;
if (window.XMLHttpRequest) 
        ajax = new XMLHttpRequest();
else
	ajax = new ActiveXObject("Msxml2.XMLHTTP"); 
	
ajax.onreadystatechange = OnReadyStateChangeRegisterShopGenericLog;	

var sURL;
var sQuery;

sURL="/tools/register_shop_generic_log.aspx";
sQuery = "affiliate=" + affiliate;
sQuery+="&shop=" + shop;
sQuery+="&customer=" + customer;
sQuery+="&type=" + type;
sQuery+="&code=" + code;
sQuery+="&p1=" + p1;
sQuery+="&p2=" + p2;
sQuery+="&p3=" + p3;
var d = new Date();
var curr_msec = d.getMilliseconds()
sQuery+="&rnd=" + curr_msec;
ajax.open("POST", sURL, false);
ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
ajax.send(sQuery); 

ajax = null;

}

function ShowPriceShipMethod(oCombo,url)
{
	document.location.href='/product.aspx'+url+'&cship='+oCombo.options[oCombo.selectedIndex].value;
}


function SearchSearchIt() {
	if (document.getElementById('txtSpSearch').value.length > 2) {
		sDummy = new String(document.getElementById('txtSpSearch').value);
		oRegExp = new RegExp(' ', 'g');
		
		document.location.href = 'list.aspx?search=' + sDummy.replace(oRegExp, '+');
	}
}

function EmailCheck(sEmail) {
	var at = "@";
	var dot = ".";
	var lat = sEmail.indexOf(at);
	var lstr = sEmail.length;
	var ldot = sEmail.indexOf(dot);

	if (sEmail.indexOf(at)==-1) { return false; }
	if (sEmail.indexOf(at)==-1 || sEmail.indexOf(at)==0 || sEmail.indexOf(at)==lstr) { return false; }
	if (sEmail.indexOf(dot)==-1 || sEmail.indexOf(dot)==0 || sEmail.indexOf(dot)==lstr) { return false; }
	if (sEmail.indexOf(at,(lat+1))!=-1) { return false; }
	if (sEmail.substring(lat-1,lat)==dot || sEmail.substring(lat+1,lat+2)==dot) { return false; }
	if (sEmail.indexOf(dot,(lat+2))==-1) { return false; }
	if (sEmail.indexOf(" ")!=-1) { return false; }

 	return true;
}


//JFS 22-09-2008
function changelanguage(ai_ilanguage){

    var sURL    = document.location.host;
    var sPath   = document.location.pathname;
    var sParams = document.location.search;

    var sMatchStr  =/(\&l=.)/;
    var sMatchStr2 =/(\?l=.)/;

    //alert(sURL);
    //alert(sPath);
    //alert(sParams);

    sParams = sParams.replace(sMatchStr, '');
    sParams = sParams.replace(sMatchStr2, '?');

    if(sParams == '') { 
        document.location.href = 'http://' + sURL + sPath + '?l=' + ai_ilanguage;
    } else {
        document.location.href = 'http://' + sURL + sPath + sParams + '&l=' + ai_ilanguage;
    }

}



function SelectCategory(ai_icategory, ai_ilevel){
	if (ai_ilevel>1)
		document.location.href='/list.aspx?c='+ai_icategory+'&md=2';
	else	
		document.location.href='/category.aspx?c='+ai_icategory;
}


function ReadCookie(cookieName) {
 var theCookie=""+document.cookie;
 var ind=theCookie.indexOf(cookieName);
 if (ind==-1 || cookieName=="") return "";
 var ind1=theCookie.indexOf(';',ind);
 if (ind1==-1) ind1=theCookie.length; 
 return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
}

function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue)
                 + ";expires="+expire.toGMTString();
}

function IsThereCookies(){
testValue=Math.floor(1000*Math.random());
SetCookie('AreCookiesEnabled',testValue);
return (testValue==ReadCookie('AreCookiesEnabled')); 
}


function showVariantContent(type, field, index, at) {
window.open('/show_variant_content.aspx?type='+type+'&field='+field+'&index='+index+'&at='+at, 'suscriber_legal_notice', 'toolbar=0,location=0,status=0,menubar=0,scrollbars=0,resizable=0,width=400,height=250,left=' + ((screen.width -400) / 2) + ',top=' + ((screen.height -250) / 2));
}

function ValidatorBefore() {
    if (document.all){
    var i;
    for (i = 0; i < Page_Validators.length; i++) {
        ValidatorValidate(Page_Validators[i]);
    }
    ValidatorUpdateIsValid();    
    Page_BlockSubmit = !Page_IsValid;
    return Page_IsValid;
    }
    else return true;
}


function showPopUp(url) {
    window.open(url, "content_pop_up", "toolbar=0,location=0,status=0,menubar=0,scrollbars=1,resizable=1,width=755,height=550,left=" + ((screen.width - 755) / 2) + ",top=" + ((screen.height - 550) / 2));
}


// VARIABLES GLOBALES ------------------------------
var ie4=document.all
var dom=document.getElementById
var curpos=10
var degree=10
var curcanvas="canvas0"
var curimageindex=0
var nextimageindex=1
// VARIABLES GLOBALES END ---------------------------




function fadepic(){
if (curpos<100){
curpos+=10
if (tempobj.filters)
tempobj.filters.alpha.opacity=curpos
else if (tempobj.style.MozOpacity)
tempobj.style.MozOpacity=curpos/101
}
else{
clearInterval(dropslide)
nextcanvas=(curcanvas=="canvas0")? "canvas0" : "canvas1"
tempobj=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
tempobj.innerHTML=insertimage(nextimageindex)
nextimageindex=(nextimageindex<fadeimages.length-1)? nextimageindex+1 : 0
var tempobj2=ie4? eval("document.all."+nextcanvas) : document.getElementById(nextcanvas)
tempobj2.style.visibility="hidden"
setTimeout("rotateimage()",pause)
}
}

function insertimage(i){
var tempcontainer=fadeimages[i][1]!=""? '<a href="'+fadeimages[i][1]+'" target="'+fadeimages[i][2]+'">' : ""
tempcontainer+='<img src="'+fadeimages[i][0]+'" border="0">'
tempcontainer=fadeimages[i][1]!=""? tempcontainer+'</a>' : tempcontainer
return tempcontainer
}

function rotateimage(){
if (ie4||dom){
resetit(curcanvas)
var crossobj=tempobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
crossobj.style.zIndex++
tempobj.style.visibility="visible"
var temp='setInterval("fadepic()",50)'
dropslide=eval(temp)
curcanvas=(curcanvas=="canvas0")? "canvas1" : "canvas0"
}
else
document.images.defaultslide.src=fadeimages[curimageindex][0]
curimageindex=(curimageindex<fadeimages.length-1)? curimageindex+1 : 0
}

function resetit(what){
curpos=10
var crossobj=ie4? eval("document.all."+what) : document.getElementById(what)
if (crossobj.filters)
crossobj.filters.alpha.opacity=curpos
else if (crossobj.style.MozOpacity)
crossobj.style.MozOpacity=curpos/101
}

function startit(){
var crossobj=ie4? eval("document.all."+curcanvas) : document.getElementById(curcanvas)
crossobj.innerHTML=insertimage(curimageindex)
rotateimage()
}



function FaderSlider(){


var preloadedimages=new Array()
for (p=0;p<fadeimages.length;p++){
preloadedimages[p]=new Image()
preloadedimages[p].src=fadeimages[p][0]
}


if (ie4||dom)
document.write('<div style="position:relative;width:'+slideshow_width+';height:'+slideshow_height+';overflow:hidden"><div  id="canvas0" style="position:absolute;width:'+slideshow_width+';height:'+slideshow_height+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10"></div><div id="canvas1" style="position:absolute;width:'+slideshow_width+';height:'+slideshow_height+';top:0;left:0;filter:alpha(opacity=10);-moz-opacity:10;visibility: hidden"></div></div>')
else
document.write('<img name="defaultslide" src="'+fadeimages[0][0]+'">')


if (ie4||dom)
window.onload=startit
else
setInterval("rotateimage()",pause)

}