/*new window links*/
function externalLinks(){
    if (!document.getElementsByTagName) return;
    
    var anchors = document.getElementsByTagName("a");
    
    for (var i=0; i<anchors.length; i++){
        var anchor = anchors[i];
        if(anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
            anchor.target = "_blank";
        }
    }
}

function OpenWindow(url,width,height) {
	var left = parseInt((screen.availWidth/2) - (width/2));
	var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height + 
        ",status=no,resizable=no,scrollbars=no,left=" + left + ",top=" + top + 
        ",screenX=" + left + ",screenY=" + top;
    wind = window.open(url, "subWind", windowFeatures);
    wind.focus();	
}

function box_close(box) {
	document.getElementById(box).style.display='none';
}
function box_show(box) {
	document.getElementById(box).style.display='block';
}
function sleep(timeout) {
	var loop = true;
    var current = new Date();
    var now;
    var cTimestamp = current.getTime();
    while(loop) {
		now = new Date();
        nTimestamp = now.getTime();

        if(nTimestamp - cTimestamp > timeout) {
        	loop = false;
        }
    }
}
function sh_off(id) {
    //alert(id);
	$('ul.omenu > li > a').removeClass('selected');
	$('#off_sec_main').hide();
	$('.off_sec').hide();
	$('#item_'+id).addClass('selected');;
	$('#'+id).show();
	$.scrollTo($('.inner'),400);
}

function sh_off_dyn(id) {
    //alert(id);
	//$('ul.omenu > li > a').removeClass('selected');
	$('#off_sec_main').hide();
	//$('.off_sec').hide();
	$('#item_'+id).addClass('selected');;
	$('#'+id).show();
	$.scrollTo($('.inner'),400);
}

function sh_offer() {
	$('ul.omenu > li > a').removeClass('selected');
	$('.off_sec').hide();
	$('#off_sec_main').show();
	$.scrollTo($('.inner'),800);
}
