// JScript File

//dailyastrology.js
function selectrashi()
    {
    var value1=document.getElementById("myselectrashi").value;
    var txt=document.getElementById("myselectrashi").options[document.getElementById("myselectrashi").selectedIndex].text;
    window.open('sandesh_astrology.aspx?Test=' + txt + '&Rblist1='+ value1+'&type=d','_blank','width=400,height=200,left=270,top=180') 
   }
   
   
   function selectrashiw()
    {
    var value1=document.getElementById("myselectrashi").value;
    var txt=document.getElementById("myselectrashi").options[document.getElementById("myselectrashi").selectedIndex].text;
    window.open('sandesh_astrology.aspx?Test=' + txt + '&Rblist1='+ value1+'&type=w','_blank','width=400,height=200,left=270,top=180') 
   }
   
   
   function selectrashiy()
    {
    var value1=document.getElementById("myselectrashi").value;
    var txt=document.getElementById("myselectrashi").options[document.getElementById("myselectrashi").selectedIndex].text;
    window.open('sandesh_astrology.aspx?Test=' + txt + '&Rblist1='+ value1+'&type=y','_blank','width=400,height=200,left=270,top=180') 
   }
//dailyastrology.js

///footer.js
function feedback()
    {     
     window.open('sandesh_feedback.aspx','_blank','width=700,height=475,left=270,top=180') 
     }
//footer.js

//mostread.js
// JScript File
function displaydivmostread(obj)
        {   document.getElementById('divread').style.display='none';
	            document.getElementById('read').style.backgroundImage='url(Images/def.gif)';
	            
	            document.getElementById('divemail').style.display='none';
	            document.getElementById('email').style.backgroundImage='url(Images/def.gif)';
	            
	            document.getElementById('divcomment').style.display='none';
	            document.getElementById('comment').style.backgroundImage='url(Images/def.gif)';
    	            

				document.getElementById('divdiscuss').style.display='none';	    
				document.getElementById('discuss').style.backgroundImage='url(Images/def.gif)';	

		          document.getElementById('div'+obj).style.display='';
		          document.getElementById(obj).style.backgroundImage='url(Images/sel.gif)';
		          }

function displaydivcityedition(obj)
        {  document.getElementById('divAhmedabad').style.display='none';
	           
	           // document.getElementById('Ahmedabad').style.background='#CCCCCC';
	            
	            document.getElementById('divBaroda').style.display='none';
	            //document.getElementById('Baroda').style.background='#CCCCCC';
	            
	            document.getElementById('divSurat').style.display='none';
	           // document.getElementById('Surat').style.background='#CCCCCC';
	            
	            document.getElementById('divRajkot').style.display='none';
	            //document.getElementById('Rajkot').style.background='#CCCCCC';
	            
		      document.getElementById('div'+obj).style.display='';
		      //document.getElementById(obj).style.background='#EAEAEA';
		        }
        function cityeditionclick(obj)
        {    document.getElementById('Ahmedabad').style.background='#CCCCCC';
	            document.getElementById('Baroda').style.background='#CCCCCC';
	            document.getElementById('Surat').style.background='#CCCCCC';
	            document.getElementById('Rajkot').style.background='#CCCCCC';
	            document.getElementById(obj).style.background='#EAEAEA';
                }
//mostread.js
//opinion.js
// JScript File

function opinionresultSelected()
    {   
    var Id=document.getElementById("ctlright_ctlopinionpoll_lblopinionId");
    var Result= Id.value;    
      var IdText=document.getElementById("ctlright_ctlopinionpoll_lblopiniontext");
    var Resultname= IdText.value;    
         window.open('sandesh_opinionresult.aspx?ID=' + Result ,'_blank','width=450,height=280,left=270,top=180')    
    }
    function opinionpreviousres()
    {
     var IdText=document.getElementById("ctlright_ctlopinionpoll_lblopiniontext");
     var Resulttext= IdText.value;
     window.open('sandesh_previous_result.aspx','_blank','width=460,height=225,left=270,top=180') 
    }
function ajaxFunction(){
	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function()
	{
		if(ajaxRequest.readyState == 4)
		{
			alert("voting successful");			
		 }
	}
	     var Id = document.getElementById("ctlright_ctlopinionpoll_lblopinionId");
	     var valueId=Id.value;
	     var chkList0= document.getElementById("ctlright_ctlopinionpoll_Rblistopinion_0");
	     var chkList1= document.getElementById("ctlright_ctlopinionpoll_Rblistopinion_1");
	     var chkList2= document.getElementById("ctlright_ctlopinionpoll_Rblistopinion_2");
	    if( chkList0!=null || chkList1!=null || chkList2!=null)
	      {
	     if(chkList0.checked==false && chkList1.checked==false && chkList2.checked==false)
	     {
	     alert('please select answer');
	     return false;
	     }
	    if(chkList0.checked)
	     {
	       var value1= chkList0.value;	       
	     }
	    if(chkList1.checked) 
	     {  
	       var value2= chkList1.value;	      
	     }
	     if(chkList2.checked)
	     {   
           var value3= chkList2.value;           
         }
      var queryString = "?Id=" + valueId;
	queryString=queryString+"&Rblist1=" + value1;
	queryString=queryString+"&Rblist2=" + value2;
	queryString=queryString+"&Rblist3=" + value3;
	ajaxRequest.open("GET", "insertopinion.aspx" + queryString, true);
	ajaxRequest.send(null);
	}
	}
function Reset()
{    var chkList0= document.getElementById("ctlright_ctlopinionpoll_Rblistopinion_0");
	     var chkList1= document.getElementById("ctlright_ctlopinionpoll_Rblistopinion_1");
	     var chkList2= document.getElementById("ctlright_ctlopinionpoll_Rblistopinion_2");
	     
	     if( chkList0!=null || chkList1!=null || chkList2!=null)
	      {
       if(chkList0.checked==false && chkList1.checked==false && chkList2.checked==false)
	     {
	     alert('please select answer');
	     return false;
	     }
        chkList0.checked=false;
        chkList1.checked=false;
        chkList2.checked=false;
        } 
}
//opinion.js
///today's headline.js
// JScript File

function todaysheadline(){
	var ajaxRequest;  // The variable that makes Ajax possible!
	var Id = document.getElementById("txtheadline");
	
	var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
    
    if(document.getElementById("txtheadline").value.match(emailExp)){}else{alert(" Please enter Correct Email address.");
    document.getElementById("txtheadline").focus();
    return false;}
    
     
     
    
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function()
	{
		if(ajaxRequest.readyState == 4)
		{
		 
		   //var ajaxDisplay = document.getElementById("Testid");
			//ajaxDisplay.innerHTML = ajaxRequest.responseText;
			alert("headline added successfully");
			Id.value="";
			
		 }
	}
	     
	     var emailvalue=Id.value
	      
      var queryString = "?Idemail=" + emailvalue;

	ajaxRequest.open("GET", "insertopinion.aspx" + queryString, true);
	ajaxRequest.send(null);
	}
	
//todayheadline.js
//archive.js
function imageclick(obj){


	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser doenot support ajax!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function()
	{
		if(ajaxRequest.readyState == 4)
		{
		   // var ajaxDisplay = document.getElementById("ajaxDiv");
			//ajaxDisplay.innerHTML = ajaxRequest.responseText;
			
		    			
			
		 }
	}
	    
	  var src1=document.getElementById(obj).src;
	  
	  var temp = new Array();
	  var temp1 = new Array();
	  temp = src1.split('/');
        var id;
        if(temp.length>1)
        {
        id=temp[temp.length-1];
        temp1 = id.split('_');
        
	    }  
	   
   
	var queryString = "?bannerid=" + temp1[0];
	
		
	ajaxRequest.open("GET", "insertopinion.aspx" + queryString, true);
	ajaxRequest.send(null); 
	 
	
	
}

function commentadd(){
if(document.getElementById("txtemail").value==""||document.getElementById("txtcomment").value=="" || document.getElementById("txtlocation").value=="" || document.getElementById("txtname").value=="")
   {
   alert('Every data is compulsary');
   return false;
   }

var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
    
    if(document.getElementById("txtemail").value.match(emailExp)){}else{alert(" Please enter Correct Email address.");
    document.getElementById("txtemail").focus();
    return false;}
    
   

	var ajaxRequest;  // The variable that makes Ajax possible!
	
	try{
		// Opera 8.0+, Firefox, Safari
		ajaxRequest = new XMLHttpRequest();
	} catch (e){
		// Internet Explorer Browsers
		try{
			ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try{
				ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e){
				// Something went wrong
				alert("Your browser broke!");
				return false;
			}
		}
	}
	// Create a function that will receive data sent from the server
	ajaxRequest.onreadystatechange = function()
	{
		if(ajaxRequest.readyState == 4)
		{
		   // var ajaxDisplay = document.getElementById("ajaxDiv");
			//ajaxDisplay.innerHTML = ajaxRequest.responseText;
		     
	 
		alert("Comment Added Successfully.");
			 document.getElementById('txtcomment').value="";
	     document.getElementById('newsid').value="";
	     document.getElementById('txtlocation').value="";
	     document.getElementById('txtemail').value="";
	     document.getElementById('txtname').value="";
			
			
			
		 }
	}
	     var Id = document.getElementById('txtcomment').value;
	     var txtNewsId = document.getElementById('newsid').value;
	     var loc=document.getElementById('txtlocation').value;
	     var email=document.getElementById('txtemail').value;
	     var name=document.getElementById('txtname').value;
   
	var queryString = "?comment=" + Id;
	queryString=queryString+"&newsId=" + txtNewsId;
	queryString=queryString+"&location=" + loc;
	queryString=queryString+"&email=" + email;
	queryString=queryString+"&name=" + name;
	
	
	ajaxRequest.open("GET", "insertopinion.aspx" + queryString, true);
	ajaxRequest.send(null); 
	 
	
	
}



function todaydate(type)
		{
		
		    var  txtDate =document.getElementById("rightpanel_ctlarchive_txtDate").value;
		    var currentTime = new Date()
			var month = currentTime.getMonth() + 1;
			var day = currentTime.getDate();
			var year = currentTime.getFullYear();
			var current = month + "/" + day  + "/" + year;
			var dd="07/17/2008";
//alert(txtDate.split('/').length);
if(txtDate.split('/').length < 3 || txtDate.split('/').length > 3)
{	alert("Date format not proper");
		return false;
}
if(Date.parse(txtDate)<Date.parse(dd))
{

	alert("Data not Available");
}
else
{
           if(trim(txtDate)=="")
		    {
				alert("Date can not blank");
				
				document.getElementById("rightpanel_ctlarchive_txtDate").focus();
				
				return false;
		    } 
		    
		   else if(Date.parse(txtDate)>Date.parse(current))
			{
			alert("Please select Correct Date");
			document.getElementById("rightpanel_ctlarchive_txtDate").focus();
			document.getElementById("rightpanel_ctlarchive_txtDate").value="";
			
			return false;
			}
			else
			{
			//alert(location.search);
			
			var temp = new Array();
			temp = txtDate.split('/');
			
			txtDate=temp[2]+"-"+temp[0]+"-"+temp[1];
			//alert(txtDate);
			    type.href="sandesh_archive.aspx"+location.search+"&date="+txtDate;
			}
			
			
			/*
			else
			{
			
			
			window.open("index.aspx?date="+txtDate,"_blank"); 
			window.open("index.aspx?date="+txtDate,"_self");
			}*/
		}
}

//archive.js
//fckeditorvalidation.js
// JScript File

        var fckBody;
        function ValidateBody(source, args) 
        {     
         args.IsValid = fckBody.GetXHTML(true) != "";   
        }    
        function FCKeditor_OnComplete(fckInstance)    
        {        
        fckBody = fckInstance;    
        }  
        
        
        function imageshow(obj)
        {
        var img=document.getElementById('ctl00_ContentPlaceHolder1_imgupload');
        img.src=document.getElementById(obj).value;
        
        }
        
        
        
        function displaydiv(obj)
        {
                myobj = "document.getElementById('"+obj+"').style.display" ;
	        if(eval(myobj) == "none")
	        { 
		        myobj =eval("document.getElementById('"+obj+"').style.display=''") ;		 
	        }	
	        else if(eval(myobj) == "")
	        { 
		        myobj =eval("document.getElementById('"+obj+"').style.display='none'") ;		 
	        }
	      
	        
        }
        
        function ScrollIt()
            {
              
              window.scrollTo(0,1015);
              
               
            
            }
        function setcoords(){
            var myPageX;
            var myPageY;
            if (document.all){
                myPageX = document.body.scrollLeft;
                myPageY = document.body.scrollTop;
                }
            else{
                myPageX = window.pageXOffset;
                myPageY = window.pageYOffset;
                }
            document.aspnetForm.ctl00$PageX.value = myPageX;
            document.aspnetForm.ctl00$PageY.value = myPageY;
            
            
            }
            
             function LTrim( value )
		 {
		    var re = /\s*((\S+\s*)*)/;
			return value.replace(re, "$1");
	     }

		// Removes ending whitespaces
		function RTrim( value )
		 {
			var re = /((\s*\S+)*)\s*/;
	 		return value.replace(re, "$1"); 
		}
		// Removes leading and ending whitespaces
	 	function trim( value )
		 {
		
			return LTrim(RTrim(value));
	     }  
	  

//fckeditorvalidation.js


function deleteAllCookies(){
	try{setCookie("htlName",null,-1);}catch(e){}
	try{setCookie("location",null,-1);}catch(e){}
	try{setCookie("order",null,-1);}catch(e){}
		for(var i=1;i<=3;i++){
			try{setCookie("chain"+i,null,-1);}catch(e){}
		}
	try{setCookie("pageNum",null,-1);}catch(e){}
	try{setCookie("amenity",null,-1);}catch(e){}
	try{setCookie("property",null,-1);}catch(e){}
}

function setCookie(c_name,value,expiredays)
{
	try{
		var exdate=new Date();
		exdate.setDate(exdate.getDate()+expiredays);
		document.cookie=c_name+ "=" +escape(value)+((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
	}catch(e){}
}

