function getWindowData(){
    var widthViewport,heightViewport,xScroll,yScroll,widthTotal,heightTotal;
    if (typeof window.innerWidth != 'undefined'){
        widthViewport= window.innerWidth;
        heightViewport= window.innerHeight;
    }else if(typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth !='undefined' && document.documentElement.clientWidth != 0){
        widthViewport=document.documentElement.clientWidth;
        heightViewport=document.documentElement.clientHeight;
    }else{
        widthViewport= document.getElementsByTagName('body')[0].clientWidth;
        heightViewport=document.getElementsByTagName('body')[0].clientHeight;
    }
    xScroll=self.pageXOffset || (document.documentElement.scrollLeft+document.body.scrollLeft);
    yScroll=self.pageYOffset || (document.documentElement.scrollTop+document.body.scrollTop);
    widthTotal=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth,widthViewport);
    heightTotal=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight,heightViewport);
    return [widthViewport,heightViewport,xScroll,yScroll,widthTotal,heightTotal];
}

$(document).ready(function(){

var data=getWindowData();
document.getElementById('pp').style.left=data[0]/2+data[2]-parseInt(document.getElementById('pp').style.width)/2+'px';
document.getElementById('pp').style.top=data[1]/2+data[3]-parseInt(document.getElementById('pp').style.height)/2+'px';

$("#country").selectbox();
$("#language").selectbox();
$('#casilla input[type=checkbox]').prettyCheckboxes();

$("#country").change(function () {

$("#language").parents('.jquery-selectbox').unselectbox();
		$("#country option:selected").each(function () {


			elegido=$(this).val();
			$.post("inc/language.php", { elegido: elegido }, function(data){
			$("#language").html(data);
		});

	});

})



$("#flaver").click(function(){
window.open($('#language').val()+'/intro.htm', '_blank', 'resizable=yes, location=no, toolbar=no, menubar=no, directories=no, status=no');
})

$("#htmlver").click(function(){

window.open($('#language').val()+"/html/home.php?co="+$("#country").val(), 'self');



})
//

$(".item-27").addClass("listelementhover");
$(".jquery-selectbox-moreButton").click(function(){
$(".jquery-selectbox-list").attr({ scrollTop: $(".jquery-selectbox-list").attr("scrollHeight")+1000
 });
})

$(".jquery-selectbox-list, .jquery-selectbox-item").mousemove(function(){
$(".item-27").removeClass("listelementhover");
$("#casilla").css("z-index","-1");

})
//jquery-selectbox-moreButton
$(".jquery-selectbox-moreButton").click(function(){
$("#casilla").css("z-index","-1");

})

$(".jquery-selectbox-list").mouseout(function(){

$("#casilla").css("z-index","1");

})
// $("#wrapper").mousemoe(function(){
// $(".jquery-selectbox-list").hide();
// $("#casilla").css("z-index","1");

// })

$(".item-27").mousemove(function(){
$(".item-27").addClass("listelementhover2");
})

$(".item-27").mouseout(function(){
$(".item-27").removeClass("listelementhover2");
})
$("#continuar").click(function(){


//alert($('#country').val());
switch($('#country').val()){
case '2':
direc = "http://www.zwyercaviarshop.ch";
 
break;
case '3':
direc = "http://www.zwyercaviarshop.fr";
break;
default:
direc = "http://www.zwyercaviarshop.com";
}
window.open(direc, 'blank');
})

});

