var nowactive=nowactive_a=nowactive_s=nowactive_n=nowactive_c='';
var old=old_a=old_s=old_n='';

function toggle_check(choise, cat){
	if(cat=='a'){
		document.contestForm.v_a.value=choise;
		old_a=nowactive_a;
		nowactive_a = choise;
		nowactive = nowactive_a;
		old = old_a;
	}
	if(cat=='s'){
		document.contestForm.v_s.value=choise;
		old_s=nowactive_s;
		nowactive_s = choise;
		nowactive = nowactive_s;
		old = old_s;
	}
	if(cat=='n'){
		document.contestForm.v_n.value=choise;
		old_n=nowactive_n;
		nowactive_n = choise;
		nowactive = nowactive_n;
		old = old_n;
	}

	if (old && old!=nowactive){
		document.getElementById(old).className='checkbx';
	}
}

function flipoff(itm, cat){
	if(cat=='a'){
		nowactive = nowactive_a;
	}
	if(cat=='s'){
		nowactive = nowactive_s;
	}
	if(cat=='n'){
		nowactive = nowactive_n;
	}
	if(cat=='country'){
		nowactive = nowactive_c;
	}	

	if (nowactive!=itm){
		document.getElementById(itm).className='checkbx';
	}
}
function flipon(itm){
	document.getElementById(itm).className='checkbx_check';
}
function swapshops(nr, shoplist, country){
	old = nowactive_c;
	nowactive_c = country;

	if (old && old!=nowactive_c){
		document.getElementById(old).className='checkbx';
	}
	
	for(i=0; i<=nr; i++){
	document.getElementById('shops'+i).style.display='none';	
	}
	
	document.getElementById(shoplist).style.display='block';

}

$(document).ready(function(){
	
	jQuery(function(){jQuery(document).pngFix();});

	var ani1=0;
	var ani2=0;
	speed=25;
	a=0;
	function up_right(){
		a+=65;
		if (jQuery.browser.msie && jQuery.browser.version==6) {
			if(a<=195) $("#pcr .curl span").css("margin-top","-"+a+"px"); else clearInterval(ani3);
		}else{
			if(a<=195) $("#pcr .curl img").css("margin-top","-"+a+"px"); else clearInterval(ani3);
		}
	}
	function down_right(){
		a+=65;
		if (jQuery.browser.msie && jQuery.browser.version==6) {
			if(a<910) $("#pcr .curl span").css("margin-top","-"+a+"px"); else clearInterval(ani4);
		}else{
			if(a<910) $("#pcr .curl img").css("margin-top","-"+a+"px"); else clearInterval(ani4);
		}
	}
	
	$("#pcr .curl").hover(
	  function () {
		a=0;
		clearInterval(ani2);
		ani1 = setInterval(up_right,speed);
	  },
	  function () {
		a=195;
		clearInterval(ani1);
		ani2 = setInterval(down_right,speed);
	  }
	)
	
	var ani3=0;
	var ani4=0;
	speed=25;
	a=0;
	function up_left(){
		a+=65;
		if (jQuery.browser.msie && jQuery.browser.version==6) {
			if(a<=195) $("#pcl .curl span").css("margin-top","-"+a+"px"); else clearInterval(ani3);
		}else{
			if(a<=195) $("#pcl .curl img").css("margin-top","-"+a+"px"); else clearInterval(ani3);
		}
	}
	function down_left(){
		a+=65;
		if (jQuery.browser.msie && jQuery.browser.version==6) {
			if(a<910) $("#pcl .curl span").css("margin-top","-"+a+"px"); else clearInterval(ani4);
		}else{
			if(a<910) $("#pcl .curl img").css("margin-top","-"+a+"px"); else clearInterval(ani4);
		}
	}
	
	$("#pcl .curl").hover(
	  function () {
		a=0;
		clearInterval(ani4);
		ani3 = setInterval(up_left,speed);
	  },
	  function () {
		a=195;
		clearInterval(ani3);
		ani4 = setInterval(down_left,speed);
	  }
	)
	
})

