﻿// JScript File

//Dynamically displaying the sub sub menu list
//Written By:-Vinit(15/09/09)
function showplanetSubMenu(IdNumber)
{        
        //alert('id =='+IdNumber);
        var count=0;
        var submenuID="";        
        var submenuStatus=document.getElementById("GodrejPrakritiTop1_hdnSubLinkStatus").value;       
	    
  if(submenuStatus=='true')
	    {	    
	        for(count=1;count<=5;count++)
            {      
                var divid='GodrejPrakritiTop1_subDiv'+count;              
                document.getElementById(divid).style.display="none";
            } 
            var showDivid='GodrejPrakritiTop1_subDiv'+IdNumber;      //alert(showDivid); 
            document.getElementById(showDivid).style.display="block";       //alert(showDivid); 
        }
}


function hideplanetSubMenu()
{        
        var count=0; 
        var submenuID="";
        var submenuStatus=document.getElementById("GodrejPrakritiTop1_hdnSubLinkStatus").value;        
	    //alert(submenuStatus);
   if(submenuStatus=='true')
	    {
	        for(count=1;count<=5;count++)
            {
                var divid='GodrejPrakritiTop1_subDiv'+count;                
                if(document.getElementById("GodrejPrakritiTop1_hidIdToHide").value!="")
                {
                    submenuID='GodrejPrakritiTop1_'+document.getElementById("GodrejPrakritiTop1_hidIdToHide").value;
                } 
                if(divid!=submenuID) 
                {          //alert(submenuID);
                    document.getElementById(divid).style.display="none";
                }
                else
                { 
                    document.getElementById(divid).style.display="block";
                }
                    
            }
       }               
}



    //Written By:-Vinit(21/05/2009)
    //Showing and Hiding the Feedback and Query Div Window //ucPropertiesTop
    function showplanetFeedBack(shodDiv,hideDiv)
    {	
    //alert('called');
      ClearFeedback();
      ClearEnquiry();
      document.getElementById('GodrejPrakritiTop1_'+shodDiv).style.display='block'; 
      document.getElementById('GodrejPrakritiTop1_tran_bg_div1').style.display='block';
      document.getElementById('GodrejPrakritiTop1_'+hideDiv).style.display='none';
      //document.getElementById('flashhide').style.display='none';
    }


    function closeplanetFeedBackEnquiry()
    {	
      //alert('called close');

      ClearFeedback();
      ClearEnquiry();
      document.getElementById('GodrejPrakritiTop1_feedback_div3').style.display='none'; 
      document.getElementById('GodrejPrakritiTop1_tran_bg_div1').style.display='none';
      document.getElementById('GodrejPrakritiTop1_feedback_div5').style.display='none';
	  //document.getElementById('flashhide').style.display='block';
      //form1.reset();
    }



//Validation of Feedback form Controls
    function validate()
    {  
       //Name
       //var Elem=document.getElementById("GodrejPrakritiTop1_TxtName");   
       if(document.getElementById("GodrejPrakritiTop1_TxtName").value=="")
       {
             alert("Please Enter Name");
	         document.getElementById("GodrejPrakritiTop1_TxtName").focus();
	         return false;       
       }
       else if(!CheckValid(document.getElementById('GodrejPrakritiTop1_TxtName').value,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&_. "))
        {
            alert("Please Enter a Valid Name");
		    document.getElementById("GodrejPrakritiTop1_TxtName").focus();
	        return false;          
        } 
       
        
        //Email ID
        //alert('email');
        if(document.getElementById("GodrejPrakritiTop1_TxtEmailId").value=="")
        {
            alert("Please Enter Email");
	        document.getElementById("GodrejPrakritiTop1_TxtEmailId").focus();
	        return false;
        }
        if(!IsValidEmail(document.getElementById("GodrejPrakritiTop1_TxtEmailId").value))
        {
            alert('Enter valid Email and try again.');
            document.getElementById("GodrejPrakritiTop1_TxtEmailId").focus();
            return false;
        }   

        //Comment
        if(document.getElementById("GodrejPrakritiTop1_TxtComments").value=="")
        {
             alert("Please Enter Comment");
	         document.getElementById("GodrejPrakritiTop1_TxtComments").focus();
	         return false;       
        }          
        var Element=document.getElementById("GodrejPrakritiTop1_TxtComments");
        if((Trim(Element.value)).length == 0)
        {
              alert("Please Enter Comment");
	         document.getElementById("GodrejPrakritiTop1_TxtComments").focus();
	         return false;  
        } 
            
        return true; 
            
     }
    //End Of Feedback Controls Validation 
     
     
     
    //Validaion controls for Send An Enquiry form
    function validate1()
    {  
       //var Elem=document.getElementById("GodrejPrakritiTop1_TxtName1");   
       if(document.getElementById("GodrejPrakritiTop1_TxtName1").value=="")
       {
             alert("Please Enter Name");
	         document.getElementById("GodrejPrakritiTop1_TxtName1").focus();
	         return false;       
       }
       else if(!CheckValid(document.getElementById('GodrejPrakritiTop1_TxtName1').value,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz&_. "))
        {
            alert("Please Enter a Valid Name");
		    document.getElementById("GodrejPrakritiTop1_TxtName1").focus();
	         return false;       
        } 
       
                  
        if(document.getElementById("GodrejPrakritiTop1_TxtEmailId1").value=="")
        {
            alert("Please Enter Email");
	        document.getElementById("GodrejPrakritiTop1_TxtEmailId1").focus();
	        return false;
        }
        if(!IsValidEmail(document.getElementById("GodrejPrakritiTop1_TxtEmailId1").value))
        {
            alert('Enter valid Email and try again.');
            document.getElementById("GodrejPrakritiTop1_TxtEmailId1").focus();
            return false;
        }
        
        if(document.getElementById('GodrejPrakritiTop1_ChkAboutUs1_3').checked==true && document.getElementById('GodrejPrakritiTop1_txtother_enquiry').value=='')
        {
            alert("Please Enter other");
            document.getElementById('GodrejPrakritiTop1_txtother_enquiry').focus();
            return false;
        }
                   
       return true; 
           
     }
     
     
     
     

    function ClearEnquiry()
    { 
        // alert("hello")
        document.getElementById("GodrejPrakritiTop1_LblMessage1").innerHTML="";
        document.getElementById("GodrejPrakritiTop1_TxtName1").value=""; 
        document.getElementById("GodrejPrakritiTop1_TxtEmailId1").value=""; 
        document.getElementById("GodrejPrakritiTop1_txtCity1").value=""; 
        document.getElementById("GodrejPrakritiTop1_TxtPhoneNo1").value="";
        document.getElementById("GodrejPrakritiTop1_TxtMobileNo1").value="";
        document.getElementById("GodrejPrakritiTop1_TxtComments1").value=""; 
                       
        for(var i=0;i<=6;i++)     //GodrejPrakritiTop1_ChkAboutUs1_0
        {
            //alert("Under For");         
            var ChkAboutUsId="GodrejPrakritiTop1_ChkAboutUs1_"+i;
            document.getElementById(ChkAboutUsId).checked=false;                   
        } 
//         
        document.getElementById('GodrejPrakritiTop1_txtother_enquiry').value='';
        document.getElementById('GodrejPrakritiTop1_txtother_enquiry').style.display='none';
        document.getElementById('GodrejPrakritiTop1_lblother').style.display='none';
        return false;       
   } 
            
            
            
    //Clear the all control of Enquiry Form            
    function ClearFeedback()
    { 
        //alert("Called")        
        document.getElementById("GodrejPrakritiTop1_LblMessage").innerHTML="";
        document.getElementById("GodrejPrakritiTop1_TxtName").value="";  
        document.getElementById("GodrejPrakritiTop1_TxtEmailId").value="";
        document.getElementById("GodrejPrakritiTop1_txtCity").value="";        
        document.getElementById("GodrejPrakritiTop1_TxtPhoneNo").value="";
        document.getElementById("GodrejPrakritiTop1_TxtMobileNo").value="";
        document.getElementById("GodrejPrakritiTop1_TxtComments").value="";
	                    
        return false;       
    } 
    
    
    
    function check_other_enquiry()
    {
        if(document.getElementById('GodrejPrakritiTop1_ChkAboutUs1_3').checked==true)
        {
            document.getElementById('GodrejPrakritiTop1_txtother_enquiry').style.display='block';
            document.getElementById('GodrejPrakritiTop1_lblother').style.display='block';
            document.getElementById('GodrejPrakritiTop1_txtother_enquiry').value='';
        }
        else
        {
            document.getElementById('GodrejPrakritiTop1_txtother_enquiry').value='';
            document.getElementById('GodrejPrakritiTop1_txtother_enquiry').style.display='none';
            document.getElementById('GodrejPrakritiTop1_lblother').style.display='none';
        }
    }
    
    
    function IsValidEmail(stremail,empty)
    {
        if(stremail=='' && empty)
            return true;
        var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
        return filter.test(stremail);
    }
     
    function CheckValid(chars,validchars)
    {   
        var blnresult=true;
        for(var i=0;i<chars.length&&blnresult==true;i++)
            {
                 var cchar=chars.charAt(i);
                 if(validchars.indexOf(cchar)==-1)
                    {
                        blnresult=false;
                    }
        
            }
         return blnresult;
     }
     
     
     
function loadAdvertisement(fileName)
{
    var str="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='592' height='430'>      <param name='movie' value='../video_plyer_final.swf?filename=Videos/"+fileName+"' />      <param name='quality' value='high' />	  <param name ='scale' value='exactfit' />	  <param name ='allowFullScreen' value='true' />            <param name='menu' value='true' />      <embed src='../video_plyer_final.swf?filename=Videos/"+fileName+"' allowFullScreen='true' scale='exactfit' width='592' height='430' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' menu='false'></embed>    </object>"
    document.getElementById('video_div').style.display="block";
    document.getElementById('divFlash').innerHTML=str;
    document.getElementById('tran_bg_div1').style.display="block";
		    var zipFile=fileName.split('.');
			
    document.getElementById('aDownload').href="download/"+zipFile[0]+".zip";
    //document.getElementById('feedback_div1_advt2').style.display="block";
}


function loadWalkthrough(fileName)
{
    var str="<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0' width='592' height='430'>      <param name='movie' value='../video_plyer_final.swf?filename=Videos/Planet/"+fileName+"' />      <param name='quality' value='high' />	  <param name ='scale' value='exactfit' />	  <param name ='allowFullScreen' value='true' />            <param name='menu' value='true' />      <embed src='../video_plyer_final.swf?filename=Videos/Planet/"+fileName+"' allowFullScreen='true' scale='exactfit' width='592' height='430' quality='high' pluginspage='http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' menu='false'></embed>    </object>"
    document.getElementById('video_div').style.display="block";
    document.getElementById('divFlash').innerHTML=str;
    document.getElementById('tran_bg_div1').style.display="block";
    //document.getElementById('feedback_div1_advt2').style.display="block";
}

function hideVideo()
{  
    document.getElementById("video_div").style.display='none';
    document.getElementById("tran_bg_div1").style.display='none'; 
    document.getElementById('divFlash').innerHTML="";
}




function showNewsHeading(imgname)
{
  //alert(imgname);
  document.getElementById('tran_bg_div1').style.display='block';
  document.getElementById('news').style.display='block';
  document.getElementById('imgMainNews').src='images/News/'+imgname;  
}


function hideNewsHeading()
{
  //alert(document.getElementById('imgMainNews').src);
  document.getElementById('tran_bg_div1').style.display='none';
  document.getElementById('news').style.display='none';
  //document.getElementById('imgMainNews').src='block';  
}


function showlocation(imgname)
{
  //alert('Press');
  document.getElementById('GodrejPrakritiTop1_tran_bg_div1').style.display='block';
  document.getElementById('locdiv').style.display='block';
  document.getElementById('flashhome').style.display='none';
  //loadfalsh(imgname);
}

function hidelocation()
{

  document.getElementById('GodrejPrakritiTop1_tran_bg_div1').style.display='none';
  document.getElementById('locdiv').style.display='none';
  document.getElementById('flashhome').style.display='block';
}

function showbestcom()
{
  document.getElementById('GodrejPrakritiTop1_tran_bg_div1').style.display='block';
  document.getElementById('locdiv3').style.display='block';
}

function hidebestcom()
{

  document.getElementById('GodrejPrakritiTop1_tran_bg_div1').style.display='none';
  document.getElementById('locdiv3').style.display='none';
}



function viewLargeImage()
{   
    window.open("fullimages/loctionlarge.jpg", "Full","status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes,titlebar=yes");
}

function showbrochure(imgname)
{
  //alert('Press');
  document.getElementById('GodrejPrakritiTop1_tran_bg_div1').style.display='block';
  document.getElementById('divbroch').style.display='block';
  //document.getElementById('flashhome').style.display='none';GodrejPrakritiTop1_tran_bg_div1
  //loadfalsh(imgname);
}

function hidebrochure()
{

  document.getElementById('GodrejPrakritiTop1_tran_bg_div1').style.display='none';
  document.getElementById('divbroch').style.display='none';
  //document.getElementById('flashhome').style.display='block';
}

function showfloor(imgname)
{
  document.getElementById('tran_bg_div1').style.display='block';
  document.getElementById('floor_plan').style.display='block';
  document.getElementById('fadeshow1').style.display='none';
  loadfalsh(imgname);
}

function hidefloor()
{

  document.getElementById('tran_bg_div1').style.display='none';
  document.getElementById('floor_plan').style.display='none';
  document.getElementById('fadeshow1').style.display='block';
}

function goToPreviousPage()
{
    window.history.go(-1);
}
function downloadZip(fileName)
{
    document.getElementById('aPdf').href="download/"+fileName;
}


function showsitemap()
{
  //alert('Press');
  document.getElementById('GodrejPrakritiTop1_tran_bg_div1').style.display='block';
  document.getElementById('sitemap').style.display='block';
  //loadfalsh(imgname);
}
function hidesitemap()
{
  document.getElementById('GodrejPrakritiTop1_tran_bg_div1').style.display='none';
  document.getElementById('sitemap').style.display='none';
}
 
