function trim(str, chars) {
	return ltrim(rtrim(str, chars), chars);
}
 
function ltrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("^[" + chars + "]+", "g"), "");
}
 
function rtrim(str, chars) {
	chars = chars || "\\s";
	return str.replace(new RegExp("[" + chars + "]+$", "g"), "");
}

var xmlHttp;
function createXmlHttpObject(){
if (window.XMLHttpRequest){     // Object of the current windows
    xmlHttp = new XMLHttpRequest();     // Firefox, Safari, ...
   } 
   else if (window.ActiveXObject){   // ActiveX version
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");  // Internet Explorer 
    } 
  return xmlHttp;
 }

xmlHttp=createXmlHttpObject();
function fetchcompatabilitySave(){
if (document.getElementById("mobileNumber").value=="Mobile no." || document.getElementById("mobileNumber").value.length!=10){
alert('please enter your 10 digit mobile number');

document.getElementById("mobileNumber").focus();
//document.body.scrollTop=0;
//window.scrollBy(50,0);
return false;
}
if (document.getElementById("name").value=="Name" || document.getElementById("name").value==""){
alert('please enter name');
document.getElementById("name").focus();
return false;
}
xmlHttp.open("POST", "/astro.do?method=checkNameMobileandSave&name="+document.getElementById("name").value+"&mobileNumber="+document.getElementById("mobileNumber").value,  true); 
xmlHttp.onreadystatechange =processStateChange;
xmlHttp.send(null);

}

function processStateChange(){
	// alert("State:"+xmlHttp.readyState+":Status:"+xmlHttp.status);
  if(xmlHttp.readyState  == 4 && xmlHttp.status  == 200) {
  document.getElementById("divComp").innerHTML="";
     var inn=document.getElementById("divComp");
     var inntext="";
     var res=xmlHttp.responseXML;
     var mess=res.getElementsByTagName("message");
     var sorr=res.getElementsByTagName("sorry");
     var comp=res.getElementsByTagName("comp");
     sorr[0].childNodes[0].nodeValue;
      window.open(encodeURI('/astro/jsp/components/mobile.jsp?name='+document.getElementById("name").value+'&camp='+comp[0].childNodes[0].nodeValue+'&sorr='+sorr[0].childNodes[0].nodeValue+'&mess='+mess[0].childNodes[0].nodeValue),'mobilecheck','width=900,height=600,resizable=1,scrollbars=1');
     //document.getElementById("divComp").innerHTML=inntext;
   }

}

function changeText(obj,tex){
  if (obj.value=='') obj.value=tex;
}
function changeTextF(obj,tex){
  if (obj.value==tex) obj.value='';
}

function isNumberKey(evt) {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;
         return true;
      }
function onlysomeNumberAllowed(obj){
    var nums="0123456789";
    if (obj.value=='') return;
    var fstr="";
    var i=0;
    for(var i=0;i<obj.value.length;i++){
     if (nums.indexOf(obj.value.charAt(i))!=-1){
      fstr=fstr+obj.value.charAt(i);
    }
   }
   obj.value=fstr;
   //alert(fstr);
}      
function onlysomeCharAllowed(obj){
    var nums="abcdefghijklmnopqrstuvwxyz ";
    if (obj.value=='') return;
    var fstr="";
    var i=0;
    for(var i=0;i<obj.value.length;i++){
     if (nums.toUpperCase().indexOf(obj.value.toUpperCase().charAt(i))!=-1){
      fstr=fstr+obj.value.charAt(i);
    }
   }
   obj.value=fstr;
   //alert(fstr);
}      

function MM_openBrWindow(theURL,winName,features) { //v2.0

  window.open(theURL,winName,features);
  fetchHoroscopeSave();
}


var xmlHttp1;
function createXmlHttpObject(){
if (window.XMLHttpRequest){     // Object of the current windows
    xmlHttp1 = new XMLHttpRequest();     // Firefox, Safari, ...
   } 
   else if (window.ActiveXObject){   // ActiveX version
    xmlHttp1 = new ActiveXObject("Microsoft.XMLHTTP");  // Internet Explorer 
    } 
  return xmlHttp1;
 }

xmlHttp1=createXmlHttpObject();

function fetchHoroscopeSave(){
if (trim(document.getElementById("hname").value)=="" || document.getElementById("hname").value=="Name"){
alert('please enter name');
document.getElementById("hname").select();
document.getElementById("hname").focus();
return false;
}
if (trim(document.getElementById("email").value)=="" || document.getElementById("email").value=="Email id"){
alert('please enter email');
document.getElementById("email").select();
document.getElementById("email").focus();
return false;
}
if (isValidEmail(document.getElementById("email").value)==false){
alert('please enter vaild email');
document.getElementById("email").select();
document.getElementById("email").focus();
return;

}
if (document.getElementById("ddd").value=="date"){
alert('please select day');
document.getElementById("ddd").focus();
return false;
}
if (document.getElementById("mmm").value=="month"){
alert('please select month');
document.getElementById("mmm").focus();
return false;
}
if (document.getElementById("yyy").value=="year"){
alert('please select year');
document.getElementById("yyy").focus();
return false;
}
if (document.getElementById("hh").value=="hh"){
alert('please select hour of birth');
document.getElementById("hh").focus();
return false;
}
if (document.getElementById("mm").value=="mm"){
alert('please select minute of birth');
document.getElementById("mm").focus();
return false;
}
/*
if (document.getElementById("ss").value=="ss"){
alert('please select second of birth');
document.getElementById("ss").focus();
return false;
}
*/
/*
if (document.getElementById("hmobile").value==""){
alert('please enter mobile number');
document.getElementById("hmobile").focus();
return false;
}
*/
if (trim(document.getElementById("location").value)=="" || document.getElementById("location").value=="Location"){
alert('please enter your location of birth');
document.getElementById("location").select();
document.getElementById("location").focus();
return false;
}
if (trim(document.getElementById("query").value)=="" || document.getElementById("query").value=="Your Question"){
alert('please enter your query');
document.getElementById("query").select();
document.getElementById("query").focus();
return false;
}
//var newurlh="method=getHoroscopeSave&name="+document.getElementById("hname").value+"&email="+document.getElementById("email").value+"&dob="+document.getElementById("mmm").value+"-"+document.getElementById("ddd").value+"-"+document.getElementById("yyy").value+"&mobile="+document.getElementById("hmobile").value+"&query="+document.getElementById("query").value;
var newurlh="method=getHoroscopeSave&name="+trim(document.getElementById("hname").value)+"&email="+trim(document.getElementById("email").value)+"&query="+trim(document.getElementById("query").value)+"&dob="+document.getElementById("mmm").value+"-"+document.getElementById("ddd").value+"-"+document.getElementById("yyy").value;
    newurlh=newurlh+"&mm="+document.getElementById("mm").value;
    newurlh=newurlh+"&ss=00";
    newurlh=newurlh+"&hh="+document.getElementById("hh").value;
    newurlh=newurlh+"&location="+trim(document.getElementById("location").value);
    //alert(newurlh);
//xmlHttp1.setRequestHeader("Content-length", newurlh.length);
xmlHttp1.open("POST", "/astro.do",  true); 
xmlHttp1.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlHttp1.onreadystatechange =processStateChange1;
xmlHttp1.send(newurlh);
 dimOff();
 alert("Thanks, You would soon get a response.");

    document.getElementById("hname").value="";
    document.getElementById("location").value="";
    document.getElementById("email").value="";
    document.getElementById("ddd").selectedIndex=0;
    document.getElementById("mmm").selectedIndex=0;
    document.getElementById("yyy").selectedIndex=0;
    document.getElementById("hh").selectedIndex=0;
    document.getElementById("mm").selectedIndex=0;
    document.getElementById("ss").selectedIndex=0;
    document.getElementById("query").value="";

//alert("/astro.do?method=getHoroscopeSave&name="+document.getElementById("hname").value+"&email="+document.getElementById("email").value+"&dob="+document.getElementById("mmm").value+"-"+document.getElementById("ddd").value+"-"+document.getElementById("yyy").value);
}

function processStateChange1(){
  //alert(xmlHttp1.readyState+":"+xmlHttp1.status);
  if(xmlHttp1.readyState  == 4 && xmlHttp1.status  == 200) {
  //alert(xmlHttp1.responseText);
  
  if (xmlHttp1.responseText=='N'){
  document.getElementById("replymaildiv").style.visibility="visible";
  document.getElementById("replymaildiv").style.display="";
  //alert("your question has been registered");
  //alert(document.getElementById("replymaildiv").style.visibility);
 // dimOff();
 // alert("Thanks, You would soon get a response.");
  }else if (xmlHttp1.responseText=='Y'){
  alert("Due to occurance of some profanity words in your query, your solution is not mailed.");
  dimOff();
  }else{
  //alert("Problem in sending mail");
 // dimOff();
  }
  }
}
//Fetch Xml Feeds
//var weeklylink="daily/english/daily/01092008_dailysunsign";
//var monthlylink="http://www.ganeshaspeaks.com/feeds/merinews/english/daily/01092008_dailysunsign";
//var yearlylink="http://www.ganeshaspeaks.com/feeds/merinews/english/daily/01092008_dailysunsign";
function getXmlFeeds(){
//alert("asd");
if (document.getElementById("sunsignfeed").selectedIndex==0){
alert('please select your sun sign');
document.getElementById("sunsignfeed").focus();
return;
}

var urls="";
//if (getCheckedValue()=='weekly') urls=weeklylink;
//if (getCheckedValue()=='monthly') urls=monthlylink;
//if (getCheckedValue()=='yearly') urls=yearlylink;
urls=getCheckedValue();
//alert(urls);
//alert(xmlHttp);


xmlHttp.open("POST", "/astro.do?method=readXmlFeed&url="+urls,true); 
//alert("send");
xmlHttp.onreadystatechange =processStateChangeFeed;
xmlHttp.send(null);
document.getElementById("waitMessage").style.visibility="visible";
document.getElementById("waitMessage").style.display="inline";
//document.getElementById("waitMessage").style.filter = 'alpha(opacity=' + 10*10 + ')';



}


function getCJXmlFeeds(){
//alert("getCJXmlFeeds");
var urls="daily";

xmlHttp.open("POST", "/astro.do?method=readXmlFeed&url="+urls,true); 
//alert("send");
xmlHttp.onreadystatechange =processStateChangeCJFeed;
xmlHttp.send(null);
//document.getElementById("waitMessage").style.visibility="visible";
//document.getElementById("waitMessage").style.display="inline";
}

function processStateChangeCJFeed(){
  if(xmlHttp.readyState  == 4 && xmlHttp.status  == 200) {
  //alert(xmlHttp.responseText);
  var res=xmlHttp.responseXML;
  //alert(xmlHttp.responseXML);
  //alert(res);
  var titles=res.getElementsByTagName("title");
  var links=res.getElementsByTagName("link");
  var links=res.getElementsByTagName("link");
  var descriptions=res.getElementsByTagName("description");
  var finaldesc="";
  var finalsign="";
  var finalRange="";
  var finalimage=""; 
  var linkOn = "";	
  
  for(var x=1;x<res.getElementsByTagName("title").length;x++){
      //alert(":"+ document.getElementById("sunsignfeed").value+":");//trim
      //alert(":"+titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')+":");//trim 
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Aries' && document.getElementById("sunsignfeed").value=='Aries'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Aries";
         finalRange="(March 21 - April 20)";
         finalimage="<a onclick=\"closePopUp('CJhoromain')\" href='http://www.ganeshaspeaks.com/horoscopes/aries.jsp?partnerName=merinews' target='blank'><img width='46' height='50' src='/astro/images/aries.gif'/></a>";
         finaldesc="<a onclick=\"closePopUp('CJhoromain')\" style='text-decoration: none' href='http://www.ganeshaspeaks.com/horoscopes/aries.jsp?partnerName=merinews' target='blank'>"+finaldesc+"</a>"
         linkOn = "http://www.ganeshaspeaks.com/horoscopes/aries.jsp?partnerName=merinews";
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Libra' && document.getElementById("sunsignfeed").value=='Libra'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Libra";
         finalRange="(September 24 - October 23)";
         //finalimage="libra.gif";
         finalimage="<a onclick=\"closePopUp('CJhoromain')\" href='http://www.ganeshaspeaks.com/horoscopes/libra.jsp?partnerName=merinews' target='blank'><img width='46' height='50' src='/astro/images/libra.gif' /></a>";
         finaldesc="<a onclick=\"closePopUp('CJhoromain')\" style='text-decoration: none' href='http://www.ganeshaspeaks.com/horoscopes/libra.jsp?partnerName=merinews' target='blank'>"+finaldesc+"</a>"
		 linkOn = "http://www.ganeshaspeaks.com/horoscopes/libra.jsp?partnerName=merinews";
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Taurus' && document.getElementById("sunsignfeed").value=='Taurus'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Taurus";
         finalRange="(April 21 - May 21)";
         finalimage="taurus.gif"; 
         finalimage="<a onclick=\"closePopUp('CJhoromain')\" href='http://www.ganeshaspeaks.com/horoscopes/taurus.jsp?partnerName=merinews' target='blank'><img width='46' height='50' src='/astro/images/taurus.gif' /></a>";
         finaldesc="<a onclick=\"closePopUp('CJhoromain')\" style='text-decoration: none' href='http://www.ganeshaspeaks.com/horoscopes/taurus.jsp?partnerName=merinews' target='blank'>"+finaldesc+"</a>"
		 linkOn = "http://www.ganeshaspeaks.com/horoscopes/taurus.jsp?partnerName=merinews";
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Gemini' && document.getElementById("sunsignfeed").value=='Gemini'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Gemini";
         finalRange="(April 21 - May 21)";
         finalimage="gemini.gif";
         finalimage="<a onclick=\"closePopUp('CJhoromain')\" href='http://www.ganeshaspeaks.com/horoscopes/gemini.jsp?partnerName=merinews' target='blank'><img width='46' height='50' src='/astro/images/gemini.gif' /></a>";
         finaldesc="<a onclick=\"closePopUp('CJhoromain')\" style='text-decoration: none' href='http://www.ganeshaspeaks.com/horoscopes/gemini.jsp?partnerName=merinews' target='blank'>"+finaldesc+"</a>"
         linkOn = "http://www.ganeshaspeaks.com/horoscopes/gemini.jsp?partnerName=merinews";
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Cancer' && document.getElementById("sunsignfeed").value=='Cancer'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Cancer";
         finalRange="(June 22 - July 23)";
         finalimage="cancer.gif"; 
         finalimage="<a onclick=\"closePopUp('CJhoromain')\" href='http://www.ganeshaspeaks.com/horoscopes/cancer.jsp?partnerName=merinews' target='blank'><img width='46' height='50' src='/astro/images/cancer.gif' /></a>";
         finaldesc="<a onclick=\"closePopUp('CJhoromain')\" style='text-decoration: none' href='http://www.ganeshaspeaks.com/horoscopes/cancer.jsp?partnerName=merinews' target='blank'>"+finaldesc+"</a>"
         linkOn = "http://www.ganeshaspeaks.com/horoscopes/cancer.jsp?partnerName=merinews";
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Leo' && document.getElementById("sunsignfeed").value=='Leo'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Leo";
         finalRange="(July 24 - August 23)";
         finalimage="leo.gif"; 
         finalimage="<a onclick=\"closePopUp('CJhoromain')\" href='http://www.ganeshaspeaks.com/horoscopes/leo.jsp?partnerName=merinews' target='blank'><img width='46' height='50' src='/astro/images/leo.gif' /></a>";
         finaldesc="<a onclick=\"closePopUp('CJhoromain')\" style='text-decoration: none' href='http://www.ganeshaspeaks.com/horoscopes/leo.jsp?partnerName=merinews' target='blank'>"+finaldesc+"</a>"
         linkOn = "http://www.ganeshaspeaks.com/horoscopes/leo.jsp?partnerName=merinews";
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Virgo' && document.getElementById("sunsignfeed").value=='Virgo'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Virgo";
         finalRange="(August 24 - September 23)";
         finalimage="virgo.gif"; 
         finalimage="<a onclick=\"closePopUp('CJhoromain')\" href='http://www.ganeshaspeaks.com/horoscopes/virgo.jsp?partnerName=merinews' target='blank'><img width='46' height='50' src='/astro/images/virgo.gif' /></a>";
         finaldesc="<a onclick=\"closePopUp('CJhoromain')\" style='text-decoration: none' href='http://www.ganeshaspeaks.com/horoscopes/virgo.jsp?partnerName=merinews' target='blank'>"+finaldesc+"</a>"
         linkOn = "http://www.ganeshaspeaks.com/horoscopes/virgo.jsp?partnerName=merinews";
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Scorpio' && document.getElementById("sunsignfeed").value=='Scorpio'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Scorpio";
         finalRange="(October 24 - November 22)";
         finalimage="scorpio.gif"; 
         finalimage="<a onclick=\"closePopUp('CJhoromain')\" href='http://www.ganeshaspeaks.com/horoscopes/scorpio.jsp?partnerName=merinews' target='blank'><img width='46' height='50' src='/astro/images/scorpio.gif' /></a>";
         finaldesc="<a onclick=\"closePopUp('CJhoromain')\" style='text-decoration: none' href='http://www.ganeshaspeaks.com/horoscopes/scorpio.jsp?partnerName=merinews' target='blank'>"+finaldesc+"</a>"
         linkOn = "http://www.ganeshaspeaks.com/horoscopes/scorpio.jsp?partnerName=merinews";
         break; 
       }
      /* if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Aries' && document.getElementById("sunsignfeed").value=='Aries'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Aries";
         finalRange="(March 21 - April 20)";
         finalimage="aries.gif"; 
         break; 
       }*/
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Sagittarius' && document.getElementById("sunsignfeed").value=='Sagittarius'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Sagittarius";
         finalRange="(November 23 - December 22)";
         finalimage="sagi.gif"; 
         finalimage="<a onclick=\"closePopUp('CJhoromain')\" href='http://www.ganeshaspeaks.com/horoscopes/sagittarius.jsp?partnerName=merinews' target='blank'><img width='46' height='50' src='/astro/images/sagi.gif' /></a>";
         finaldesc="<a onclick=\"closePopUp('CJhoromain')\" style='text-decoration: none' href='http://www.ganeshaspeaks.com/horoscopes/sagittarius.jsp?partnerName=merinews' target='blank'>"+finaldesc+"</a>"
         linkOn = "http://www.ganeshaspeaks.com/horoscopes/sagittarius.jsp?partnerName=merinews";
         break; 
       }
       
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Capricorn' && document.getElementById("sunsignfeed").value=='Capricorn'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Capricorn";
         finalRange="(December 23 - January 20)";
         finalimage="capricon.gif"; 
         finalimage="<a onclick=\"closePopUp('CJhoromain')\" href='http://www.ganeshaspeaks.com/horoscopes/capricorn.jsp?partnerName=merinews' target='blank'><img width='46' height='50' src='/astro/images/capricon.gif' /></a>";
         finaldesc="<a onclick=\"closePopUp('CJhoromain')\" style='text-decoration: none' href='http://www.ganeshaspeaks.com/horoscopes/capricorn.jsp?partnerName=merinews' target='blank'>"+finaldesc+"</a>"
         linkOn = "http://www.ganeshaspeaks.com/horoscopes/capricorn.jsp?partnerName=merinews";
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Aquarius' && document.getElementById("sunsignfeed").value=='Aquarius'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Aquarius";
         finalRange="(January 21 - February 19)";
         finalimage="aquarius.gif"; 
         finalimage="<a onclick=\"closePopUp('CJhoromain')\" href='http://www.ganeshaspeaks.com/horoscopes/aquarius.jsp?partnerName=merinews' target='blank'><img width='46' height='50' src='/astro/images/aquarius.gif' /></a>";
         finaldesc="<a onclick=\"closePopUp('CJhoromain')\" style='text-decoration: none' href='http://www.ganeshaspeaks.com/horoscopes/aquarius.jsp?partnerName=merinews' target='blank'>"+finaldesc+"</a>"
         linkOn = "http://www.ganeshaspeaks.com/horoscopes/aquarius.jsp?partnerName=merinews";
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Pisces' && document.getElementById("sunsignfeed").value=='Pisces'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Pisces";
         finalRange="(February 20 - March 20)";
         finalimage="pisces.gif"; 
         finalimage="<a onclick=\"closePopUp('CJhoromain')\" href='http://www.ganeshaspeaks.com/horoscopes/pisces.jsp?partnerName=merinews' target='blank'><img width='46' height='50' src='/astro/images/pisces.gif' /></a>";
         finaldesc="<a onclick=\"closePopUp('CJhoromain')\" style='text-decoration: none' href='http://www.ganeshaspeaks.com/horoscopes/pisces.jsp?partnerName=merinews' target='blank'>"+finaldesc+"</a>"
         linkOn = "http://www.ganeshaspeaks.com/horoscopes/pisces.jsp?partnerName=merinews";
         break; 
       }
      }
      finaldesc=finaldesc.replace(";",".").replace("&",'.');
      if (finaldesc!=""){
      //window.open('/astro/popupFeed.jsp?imgname='+finalimage+'&signname='+finalsign+'&description='+finaldesc+'&finalRange='+finalRange,'','width=370,height=250,scrollbars=1');
      
      	document.getElementById('CJhoromain').style.visibility='visible';
	    document.getElementById('CJhoromain').style.display='';// none;
	    document.getElementById('CJhoroDesc').innerHTML="";
      	document.getElementById('CJhoroDesc').innerHTML=finaldesc;
      	document.getElementById('CJhoroImg').innerHTML="";
      	document.getElementById('CJhoroImg').innerHTML=finalimage;
      	document.getElementById('poweredBy').href=linkOn;
      	document.getElementById('poweredBy1').href=linkOn;
      	//document.getElementById('CJhoroImg').innerHTML=finaldesc;
      	 
      }else{
      //alert("Data not found");
      }
      document.getElementById("waitMessage").style.visibility="hidden";
      document.getElementById("waitMessage").style.display="none";
    }
}


function processStateChangeFeed(){
  if(xmlHttp.readyState  == 4 && xmlHttp.status  == 200) {
  //alert(xmlHttp.responseText);
  var res=xmlHttp.responseXML;
  //alert(xmlHttp.responseXML);
  //alert(res);
  var titles=res.getElementsByTagName("title");
  var links=res.getElementsByTagName("link");
  var links=res.getElementsByTagName("link");
  var descriptions=res.getElementsByTagName("description");
  var finaldesc="";
  var finalsign="";
  var finalRange="";
  var finalimage=""; 
  for(var x=1;x<res.getElementsByTagName("title").length;x++){
      //alert(":"+ document.getElementById("sunsignfeed").value+":");//trim
      //alert(":"+titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')+":");//trim 
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Aries' && document.getElementById("sunsignfeed").value=='Aries'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Aries";
         finalRange="(March 21 - April 20)";
         finalimage="aries.gif";
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Libra' && document.getElementById("sunsignfeed").value=='Libra'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Libra";
         finalRange="(September 24 - October 23)";
         finalimage="libra.gif";
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Taurus' && document.getElementById("sunsignfeed").value=='Taurus'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Taurus";
         finalRange="(April 21 - May 21)";
         finalimage="taurus.gif"; 
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Gemini' && document.getElementById("sunsignfeed").value=='Gemini'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Gemini";
         finalRange="(April 21 - May 21)";
         finalimage="gemini.gif"; 
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Cancer' && document.getElementById("sunsignfeed").value=='Cancer'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Cancer";
         finalRange="(June 22 - July 23)";
         finalimage="cancer.gif"; 
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Leo' && document.getElementById("sunsignfeed").value=='Leo'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Leo";
         finalRange="(July 24 - August 23)";
         finalimage="leo.gif"; 
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Virgo' && document.getElementById("sunsignfeed").value=='Virgo'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Virgo";
         finalRange="(August 24 - September 23)";
         finalimage="virgo.gif"; 
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Scorpio' && document.getElementById("sunsignfeed").value=='Scorpio'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Scorpio";
         finalRange="(October 24 - November 22)";
         finalimage="scorpio.gif"; 
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Aries' && document.getElementById("sunsignfeed").value=='Aries'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Aries";
         finalRange="(March 21 - April 20)";
         finalimage="aries.gif"; 
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Sagittarius' && document.getElementById("sunsignfeed").value=='Sagittarius'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Sagittarius";
         finalRange="(November 23 - December 22)";
         finalimage="sagi.gif"; 
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Capricorn' && document.getElementById("sunsignfeed").value=='Capricorn'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Capricorn";
         finalRange="(December 23 - January 20)";
         finalimage="capricon.gif"; 
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Aquarius' && document.getElementById("sunsignfeed").value=='Aquarius'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Aquarius";
         finalRange="(January 21 - February 19)";
         finalimage="aquarius.gif"; 
         break; 
       }
       if (titles[x].childNodes[0].nodeValue.replace(/^\s+/, '').replace(/\s+$/, '')=='Pisces' && document.getElementById("sunsignfeed").value=='Pisces'){
         finaldesc=descriptions[x].childNodes[0].nodeValue;
         finalsign="Pisces";
         finalRange="(February 20 - March 20)";
         finalimage="pisces.gif"; 
         break; 
       }
      }
      finaldesc=finaldesc.replace(";",".").replace("&",'.');
      if (finaldesc!=""){
      window.open('/astro/popupFeed.jsp?imgname='+finalimage+'&signname='+finalsign+'&description='+finaldesc+'&finalRange='+finalRange,'','width=370,height=250,scrollbars=1');
      }else{
      alert("Data not found");
      }
      document.getElementById("waitMessage").style.visibility="hidden";
      document.getElementById("waitMessage").style.display="none";
    }
}
function getCheckedValue() {
var sel="weekly";
 for(var kk=0;kk<document.getElementById("feedForm").elements.length-1;kk++){
  if (document.getElementById("feedForm").elements[kk].type=='radio' && document.getElementById("feedForm").elements[kk].checked){
 sel=document.getElementById("feedForm").elements[kk].value;
 }
  }
  return sel;
 }
 /*
	if(!radioObj)
		return "";
	var radioLength = radioObj.length;
	if(radioLength == undefined)
		if(radioObj.checked)
			return radioObj.value;
		else
			return "";
	for(var i = 0; i < radioLength; i++) {
		if(radioObj[i].checked) {
			return radioObj[i].value;
		}
	}
*/	
//	return "";
//}
//askNow()
function askNow(){
      askwindow=window.open('/astro/jsp/components/overlay.jsp','askastro','width=420,height=260,resizable=no,scrollbars=no');
      askwindow.moveTo(220,220);
      

}
function cutString(obj,howmany,mess){
 if (obj.value.length>howmany){
    alert(mess+" should not be greater than "+howmany+" words.");
    obj.value=obj.value.substring(0,250);
  }
}

