// JavaScript Document
//=========General===========
function RefreshImage() {
	document.getElementById('captcha').src='scripts/cool-php-captcha-0.3/captcha.php?'+Math.random();
}

//========= HOME PAGE BANNER =========
var swflink = "javascript:void(0)";
 var flashvars = false;
 var params = {};
 params.menu = "false";
 params.bgcolor = "#000000";
 params.wmode = "transparent";
 var attributes = false;
 swfobject.embedSWF("flash/vebr_banner.swf", "vebr_banner", "935", "425", "8", swflink, flashvars, params, attributes);
//========= HOME PAGE BANNER =========
var swflink2 = "javascript:void(0)";
 var flashvars2 = false;
 var params2 = {};
 params2.menu = "false";
 params2.bgcolor = "#000000";
 params2.wmode = "transparent";
 var attributes2 = false;
 swfobject.embedSWF("flash/ad-panorama.swf", "adpanorama", "212", "125", "8", swflink2, flashvars2, params2, attributes2);
//======================================
$(document).ready(function() {

	$('a.fbox').each(function(){
           var dWidth 	= parseInt($(this).attr('href').match(/width=[0-9]+/i)[0].replace('width=',''));
           var dHeight 	=  parseInt($(this).attr('href').match(/height=[0-9]+/i)[0].replace('height=',''));
			$(this).fancybox({
				'width'				:dWidth,
				'height'			:dHeight,
				'autoScale'			: false,
				'transitionIn'		: 'fade',
				'transitionOut'		: 'fade',
				'type'				: 'iframe',
				'titleShow'			: false
			});
      });
	$("a[rel=mygall]").fancybox({
		'transitionIn'		: 'fade',
		'transitionOut'		: 'fade',
		'titlePosition' 	: 'over',
		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
		    return '<span id="fancybox-title-over">Image ' +  (currentIndex + 1) + ' / ' + currentArray.length + ' ' + title + '</span>';
		}
	});
	

//	$('.slicktoggle').click(function() {
//	//$('.hidetoggle').hide('slow');
//	$(this).parent().parent().next().toggle(400);
//	return false;
//	});
//	
	$('.slicktoggle2').click(function() {
	//$('.hidetoggle2').hide('slow');
	$(this).parent().parent().next().toggle(400);
	return false;
	});
	
	$('#frmenquiry').submit(function() { return check_frm(this); });

	function check_frm(frm) {
	if (frm.pname.value=="" || frm.pname.value=="Your Name")
    {
	  frm.pname.style.backgroundColor='#F8E7E7';
      return false;
    }
	if (frm.pemail.value=="" || frm.pemail.value=="Contact Email")
    {
	  frm.pemail.style.backgroundColor='#F8E7E7';
      return false;
    }
	if (invalidemail(frm.pemail.value))
    {
	  frm.pemail.style.backgroundColor='#F8E7E7';
      return false;
    }
	if (frm.pmessage.value=="" || frm.pmessage.value=="Your Query / Message")
    {
	  frm.pmessage.style.backgroundColor='#F8E7E7';
      return false;
    }	
	return true;
	}

	function invalidemail(s)
	{
	  res=0;
	  len=s.length;
	   for(i=0;i<len;i++)
		 { 
		   if(s.charAt(i)=='@' )
		 
	   for(j=i;j<len;j++)
				{
				  if(s.charAt(j)=='.')
					  res=1;
				 }
		 }  
	if (res==0)
		return true; 
	  else
		 return false; 
	}

	// TABS
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content

	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$("#tab1").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		switch (activeTab)
		{
		case "#tab1":
		   $("#tabiframe").html('<iframe frameborder=\"0\" width=\"640\" height=\"400\" name=\"vox360\" src=\"http://www.victorexoticagoa.com/flash/vox360/lobby.htm\" scrolling=\"no\" allowtransparency=\"0\" style=\"background:#FFF;\"></iframe>');
		  break;
		case "#tab2":
		   $("#tabiframe").html('<iframe frameborder=\"0\" width=\"640\" height=\"400\" name=\"vox360\" src=\"http://www.victorexoticagoa.com/flash/vox360/room.htm\" scrolling=\"no\" allowtransparency=\"0\" style=\"background:#FFF;\"></iframe>');
		  break;
		case "#tab3":
		   $("#tabiframe").html('<iframe frameborder=\"0\" width=\"640\" height=\"400\" name=\"vox360\" src=\"http://www.victorexoticagoa.com/flash/vox360/twin-room.htm\" scrolling=\"no\" allowtransparency=\"0\" style=\"background:#FFF;\"></iframe>');
		  break;
		case "#tab4":
		   $("#tabiframe").html('<iframe frameborder=\"0\" width=\"640\" height=\"400\" name=\"vox360\" src=\"http://www.victorexoticagoa.com/flash/vox360/conference.htm\" scrolling=\"no\" allowtransparency=\"0\" style=\"background:#FFF;\"></iframe>');
		  break;
		case "#tab5":
		   $("#tabiframe").html('<iframe frameborder=\"0\" width=\"640\" height=\"400\" name=\"vox360\" src=\"http://www.victorexoticagoa.com/flash/vox360/spa.htm\" scrolling=\"no\" allowtransparency=\"0\" style=\"background:#FFF;\"></iframe>');
		  break;
		case "#tab6":
		   $("#tabiframe").html('<iframe frameborder=\"0\" width=\"640\" height=\"400\" name=\"vox360\" src=\"http://www.victorexoticagoa.com/flash/vox360/restaurant.htm\" scrolling=\"no\" allowtransparency=\"0\" style=\"background:#FFF;\"></iframe>');
		  break;
		case "#tab7":
		   $("#tabiframe").html('<iframe frameborder=\"0\" width=\"640\" height=\"400\" name=\"vox360\" src=\"http://www.victorexoticagoa.com/flash/vox360/pool.htm\" scrolling=\"no\" allowtransparency=\"0\" style=\"background:#FFF;\"></iframe>');
		  break;
		case "#tab8":
		   $("#tabiframe").html('<iframe frameborder=\"0\" width=\"640\" height=\"400\" name=\"vox360\" src=\"http://www.victorexoticagoa.com/flash/vox360/exterior-day.htm\" scrolling=\"no\" allowtransparency=\"0\" style=\"background:#FFF;\"></iframe>');
		  break;
		case "#tab9":
		   $("#tabiframe").html('<iframe frameborder=\"0\" width=\"640\" height=\"400\" name=\"vox360\" src=\"http://www.victorexoticagoa.com/flash/vox360/exterior-night.htm\" scrolling=\"no\" allowtransparency=\"0\" style=\"background:#FFF;\"></iframe>');
		  break;
		}
		$("#tab1").fadeIn(); //Fade in the active content
		return false;
	});


});
//=======================================

