last_tab = 'tab01';

//** Module Popup script Start
/*$(document).ready(function () {
	$('#basicModal input.seltour, #basicModal a.seltour').click(function (e) {
		e.preventDefault();
		$('#basicModalseltour').modal();
	});
});*/

$(document).ready(function () {
	/*$('#basicModal input.basic1, #basicModal a.basic1').click(function (e) {
	    e.preventDefault();
	$('#basicModalContent1').modal();
	});*/
	 $('a[rel*=facebox]').facebox();	 
	 $.facebox.settings.opacity = 0.5
	// jQuery("BODY").bind('click', function(){trackbindid(this)});

});

$("body").append("<div id='opaque' style='display: none;'></div>");

$(document).bind('loading.facebox', function() {
    $("#opaque").show();
});
$(document).bind('close.facebox', function() {
    $("#opaque").hide();
});
$(document).bind('afterReveal.facebox', function() {
    // this is a fix for IE6 which resets the height to 100% of the window height
    $("#opaque").height($(document).height());
});









function getElementLeft(Elem) {
	var elem;
	if(document.getElementById) {
		var elem = document.getElementById(Elem);
	} else if (document.all){
		var elem = document.all[Elem];
	}
	xPos = elem.offsetLeft;
	tempEl = elem.offsetParent;
		while (tempEl != null) {
			xPos += tempEl.offsetLeft;
  		tempEl = tempEl.offsetParent;
		}
	return xPos;
}

function getElementTop(Elem) {
	
	if(document.getElementById) {	
		var elem = document.getElementById(Elem);
	} else if (document.all) {
		var elem = document.all[Elem];
	}
	yPos = elem.offsetTop;
	tempEl = elem.offsetParent;
	while (tempEl != null) {
		yPos += tempEl.offsetTop;
  		tempEl = tempEl.offsetParent;
	}
	return yPos;	
}

function showtab(layerName) {
	document.getElementById(layerName).style.display = '';
}

function hidetab(layerName) {
	document.getElementById(layerName).style.display = 'none';
}

function show_next(tab_name) {
	document.getElementById(last_tab).className = 'tab';
	var curr = document.getElementById(tab_name);
	curr.className='tab_hover';
	hidetab(last_tab+'_data');
	showtab(tab_name+'_data');
	last_tab=tab_name;
}

function closeDivWindow(divName)
{
	
	$("#"+divName).hide("slow");
	$('#layer').hide();
}




function submitComboForm(action){
	document.comboForm.action=action;
	document.comboForm.submit();
}



  
  function selectDietary(val,id){
  	if(val=='Others'){
  		$("#"+id).show();
  	}else{
  		$("#"+id).hide();
  	}
  }
  
  function openwindow(url,width,height){
	width=1000;
	height=800;	
	settings="location=0,status=0,resizable=1,scrollbars=1,width="+width+",height="+height;
		mywindow = window.open (url,
	  "mywindow",settings);
	  mywindow.moveTo(0,0);
	  return false;
	}

//** Module Popup script Ends
