// JavaScript Document

window.oncontextmenu = function() { return false; }

$(document).ready( function(){
	if( navigator.userAgent.match(/MSIE [6-8]/i) ) {
		$('.rounded').corners("5px");
	}
});

//------------------------------------------

function adjustWidth(width) {
    width = parseInt(width);
	if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) || (navigator.userAgent.match(/iPad/i))) { 
		$("#size-stylesheet").attr("href", "../style/sbenito-ip.css");
	} else {
		if (width < 940) {
			$("#size-stylesheet").attr("href", "../style/sbenito-narrow.css");
		} else {
			$("#size-stylesheet").attr("href", "../style/sbenito-wide.css");
		}
	}
}

adjustWidth($(window).width());


$(document).ready( function() {
    $(window).resize(function() {
        adjustWidth($(window).width());
    });
});

//------------------------------------------

function barStyle(height) {
	height = parseInt(height);
	if (height < 480) { 
		$("#logo").css("position","absolute"); 
		$("#sidebar").css("position","absolute");
		$("#imgbar").css("position","absolute");
	} else {
		$("#logo").css("position","fixed"); 
		$("#sidebar").css("position","fixed");
		$("#imgbar").css("position","fixed");
	}
}

$(document).ready( function() {
    barStyle($(window).height());
    $(window).resize(function() {
        barStyle($(window).height());
    });
});

//------------------------------------------

function JumpMenu(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// -------------------------------------------

function Contact(url) {
	window.open(url, 'FormContacto', 'width=470px, height=370px, directories=no, location=no, resizable=no, menubar=no, toolbar=no, scrollbars=no, status=no');
}
