﻿// JScript File


var RootPath =  'http://quest.webdunia.com';  //




var LangId   = document.getElementById('ctl00_hdnLangId').value   ;
var LangAbbr  =   document.getElementById('ctl00_hdnLangAbbr').value   ;
var LanguageName  =   document.getElementById('ctl00_hdnLanguageName').value   ;

var cuurentPage = document.getElementById('ctl00_ContentPlaceHolder1_hdncrrentPage').value   ;

var UserId = document.getElementById ('ctl00_hdnUserId').value   ;

//   function HeaderLinguistic()
{
if ( UserId > 0 )
{

document.getElementById('myProfileLnk').innerHTML  = "My Profile"   ;
 //document.getElementById('ctl00_hdnMyProfile').value;
 
 }
else
{
    document.getElementById('myProfileLnk').innerHTML  = "Register";
    document.getElementById('myProfileLnk').href="http://accounts.webdunia.com/register.php?lang=" + LangAbbr + "&pid=16&sid=85&return_path="+ cuurentPage    //   RootPath + "/index.aspx";
    
    
}
document.getElementById('searchLnk').value =    "Search"   ;   //   document.getElementById('ctl00_hdnSearch').value;
document.getElementById('advancedSearchLnk').innerHTML = "Advanced Search"   ;
//   document.getElementById('ctl00_hdnAdvancedSearch').value;


//if ( LangId > 1 )
//{

//document.getElementById('webduniaLnk').innerHTML = document.getElementById('ctl00_hdnwebdfuniaLnk').value;
//document.getElementById('mailLnk').innerHTML = document.getElementById('ctl00_hdnmailLnk').value;
//document.getElementById('searchLnk2').innerHTML = document.getElementById('ctl00_hdnsearchLnk').value;
//document.getElementById('myWebduniaLnk').innerHTML = document.getElementById('ctl00_hdnmyWebduniaLnk').value;
//document.getElementById('eGreetingsLnk').innerHTML = document.getElementById('ctl00_hdneGreetingsLnk').value;
//document.getElementById('newsLnk').innerHTML = document.getElementById('ctl00_hdnnewsLnk').value;
//document.getElementById('gamesLnk').innerHTML = document.getElementById('ctl00_hdngamesLnk').value;

if(LangId>1)
{
    document.getElementById('webduniaLnk').href =  "http://" + LanguageName + ".webdunia.com" ;
    document.getElementById('eGreetingsLnk').href = "http://" + LangAbbr + ".greetings.webdunia.com" ;
    document.getElementById('newsLnk').href = "http://" + LanguageName + "news.webdunia.com";
}
else
{
    document.getElementById('webduniaLnk').href =  "http://www.webdunia.com" ;
    document.getElementById('eGreetingsLnk').href = "http://egreetings.webdunia.com" ;
    document.getElementById('newsLnk').href = "http://news.webdunia.com";
}   
//document.getElementById('mailLnk').href = " http://mail.webdunia.com";
document.getElementById('searchLnk2').href = "http://search.webdunia.com/Default.aspx?lid=" + LangAbbr ;

document.getElementById('myWebduniaLnk').href = 'http://' + LanguageName + '.mywebdunia.com' ;


document.getElementById('gamesLnk').href = "http://games.webdunia.com/index.aspx?id="+ LangId + "&code=" + LangAbbr  ;


if ( LangId > 1 )
{
document.getElementById('fonthelpLnk').href=   "http://"+LanguageName+".webdunia.com/help/fonthelp.htm"    ;
document.getElementById('fonthelpLnk').innerHTML = " Font Help "; 
document.getElementById('fontdownloadLnk').href = "http://"+ LanguageName +".webdunia.com/help/downloadFont.htm"   ;
document.getElementById('fontdownloadLnk').innerHTML = "  | Font Download | "   ;

//  document.getElementById('Qlogo').src =  rootpath +"/images/questlogo_"+ LangAbbr +".gif"   ;
}


//}

}


// function Ends for Linguistic Header
// For Login Page Ends
// function footerlinks(RootPath)
{
    var strUserId = document.getElementById("ctl00_hdnUserId").value;
////////removed    var askLink = document.getElementById("asklink"); 
////////removed    var sbmtLink = document.getElementById("sbmtlink");
    if ( strUserId >= 0 )
    {    
////////removed    askLink.href = RootPath + "/index.aspx";
////////removed    sbmtLink.href = RootPath + "/CategoryQuestions.aspx";
    }
    else
    if ( strUserId < 0 )
    {     
////////removed        askLink.href = RootPath + "/login.aspx";
////////removed        sbmtLink.href = RootPath + "/Login.aspx?action=sbmtAns";    
    }
}

//function visibles( RootPath , LangAbbr )
{
    var strUserId = document.getElementById("ctl00_hdnUserId").value;
    var strUserName = document.getElementById("ctl00_hdnUserName").value;
    var welcomelink = document.getElementById("welcomelink"); 
    var signoutlink = document.getElementById("signoutlink");     
    var signinlink = document.getElementById("signinlink");     
    var lgnSpan = document.getElementById("lgnspan"); 
    if ( strUserId < 0 )
    {     
      signinlink.innerHTML = "Sign In";
      //signInLink.href  = RootPath + "/Login.aspx"; 
     // signinlink.href="#";
      //RegisterLink.innerHTML ="  Register";    
      //RegisterLink.href = "http://accounts.webdunia.com/register.php?lang=" + LangAbbr + "&pid=16&sid=85&return_path="+ RootPath + "/Login.aspx"
      signOutLink.innerHTML = "";
    }
    else
    if ( strUserId > 0 )
    {
        signinlink.innerHTML ="";    
        welcomelink.innerHTML = "Welcome " + strUserName;
       // signInLink.href = "javascript:void(0)";
        signoutlink.innerHTML ="   Sign Out";
    }
     else   if ( strUserId == 0 )
    {
        
        signoutlink.innerHTML ="";    
        welcomelink.innerHTML = "Welcome " + " GUEST " ;
        //   signInLink.href = "javascript:void(0)";
        signinlink.innerHTML = "Sign In";
        //signinlink.href="#";
        //RegisterLink.innerHTML ="  Register";    
      //RegisterLink.href = "http://accounts.webdunia.com/register.php?lang=" + LangAbbr + "&pid=16&sid=85&return_path="+ RootPath + "/Login.aspx"
    }

}


// Function for visible Ends

//WiocliteSearchUtil Starts

 var LangAbbr = document.getElementById ('ctl00_hdnLangAbbr').value ;
 var MoreControls = document.getElementById ( 'hdnMoreControls').value;


if ( LangAbbr !="EN" )
{



//onControlLoadSeachTextBox ( LangAbbr );
if ( MoreControls == "yes" )
{

//onChildLoad1();
//loadKeyboard();

}
//document.getElementById ( 'dvWiocLiteTempJs' ).innerHTML =  document.getElementById ( 'ctl00_dvWiocLiteTempJs1' ).innerHTML
//document.getElementById ( 'ctl00_dvWiocLiteTempJs1' ).innerHTML = "";
}

else

{

document.getElementById ( 'dvWiocLiteTempJs' ).innerHTML = "<input type='text' style='height:12px;width:170px;valign:top;' id='txtSearch' >";

}
var qaURL,politicalQAURL,astrologyQAURL,travelQAURL,educationQAURL,generalQAURL,generalhealthQAURL;
switch(LangId)
    {   
        case "1":
            qaURL=RootPath+'/english/1/index.html';
            politicalQAURL=RootPath + "/english/elections/76/1/categoryquestions.html";
            astrologyQAURL= RootPath+ "/english/astrology/179/1/categoryquestions.html";
            travelQAURL=RootPath+ "/english/international-destinations/39/1/categoryquestions.html";
            educationQAURL=RootPath+ "/english/education/52/1/categoryquestions.html";
            generalQAURL=RootPath+ "/english/general/others/25/1/categoryquestions.html";
            generalhealthQAURL=RootPath+ "/english/general-health-care/60/1/categoryquestions.html";
            break;
        case "2":
            qaURL=RootPath+ '/hindi/2/index.html';
            politicalQAURL=RootPath+ "/hindi/elections/13/2/categoryquestions.html";
            astrologyQAURL=RootPath+ "/hindi/astrology/199/2/categoryquestions.html";
            travelQAURL=RootPath+ "/hindi/international-destinations/44/2/categoryquestions.html";
            educationQAURL=RootPath+ "/hindi/education/6/2/categoryquestions.html";
            generalQAURL=RootPath+ "/hindi/general/general/others/36/2/categoryquestions.html";
            generalhealthQAURL=RootPath+ "/hindi/general-health-care/77/2/categoryquestions.html";
            break;
        case "3":
            qaURL=RootPath+ '/marathi/3/index.html';
            politicalQAURL=RootPath+ "/marathi/elections/68/3/categoryquestions.html";
            astrologyQAURL=RootPath+ "/english/astrology/179/1/categoryquestions.html";
            travelQAURL=RootPath+ "/marathi/international-destinations/10/3/categoryquestions.html";
            educationQAURL=RootPath+ "/marathi/education/31/3/categoryquestions.html";
            generalQAURL=RootPath+ "/english/general/others/25/1/categoryquestions.html";
            generalhealthQAURL=RootPath+ "/marathi/general-health-care/43/3/categoryquestions.html";
            break;
        case "4":
            qaURL=RootPath+ '/malayalam/4/index.html';
            politicalQAURL=RootPath+ "/malayalam/elections/86/4/categoryquestions.html";
            astrologyQAURL=RootPath+ "/malayalam/astrology/181/4/categoryquestions.html";
            travelQAURL=RootPath+ "/malayalam/international-destinations/37/4/categoryquestions.html";
            educationQAURL=RootPath+ "/malayalam/education/6/4/categoryquestions.html";
            generalQAURL=RootPath+ "/malayalam/general/others/30/4/categoryquestions.html";
            generalhealthQAURL=RootPath+ "/malayalam/general-health-care/66/4/categoryquestions.html";
            break;
        case "5":
            qaURL=RootPath+ '/punjabi/5/index.html';
            politicalQAURL=RootPath+ "/punjabi/elections/70/5/categoryquestions.html";
            astrologyQAURL=RootPath+ "/punjabi/astrology/180/5/categoryquestions.html";
            travelQAURL=RootPath+ "/punjabi/international-destinations/12/5/categoryquestions.html";
            educationQAURL=RootPath+ "/punjabi/education/33/5/categoryquestions.html";
            generalQAURL=RootPath+ "/punjabi/general/others/178/5/categoryquestions.html";
            generalhealthQAURL=RootPath+ "/punjabi/general-health-care/45/5/categoryquestions.html";
            break;
        case "6":
            qaURL=RootPath+ '/tamil/6/index.html';
            politicalQAURL=RootPath+ "/tamil/elections/89/6/categoryquestions.html";
            astrologyQAURL=RootPath+ "/tamil/astrology/186/6/categoryquestions.html";
            travelQAURL=RootPath+ "/tamil/international-destinations/39/6/categoryquestions.html";
            educationQAURL=RootPath+ "/tamil/education/6/6/categoryquestions.html";
            generalQAURL=RootPath+ "/tamil/general/others/30/6/categoryquestions.html";
            generalhealthQAURL=RootPath+ "/tamil/general-health-care/68/6/categoryquestions.html";
            break;
        case "7":
            qaURL=RootPath+ '/gujarati/7/index.html';
            politicalQAURL=RootPath+ "/gujarati/elections/70/7/categoryquestions.html";
            astrologyQAURL=RootPath+ "/gujarati/astrology/178/7/categoryquestions.html";
            travelQAURL=RootPath+ "/gujarati/international-destinations/13/7/categoryquestions.html";
            educationQAURL=RootPath+ "/gujarati/education/33/7/categoryquestions.html";
            generalQAURL=RootPath+ "/gujarati/general/others/176/7/categoryquestions.html";
            generalhealthQAURL=RootPath+ "/gujarati/general-health-care/45/7/categoryquestions.html";
            break;
        case "8":
            qaURL=RootPath+ '/bengali/8/index.html';
            politicalQAURL=RootPath+ "/bengali/elections/70/8/categoryquestions.html";
            astrologyQAURL=RootPath+ "/bengali/astrology/182/8/categoryquestions.html";
            travelQAURL=RootPath+ "/bengali/international-destinations/12/8/categoryquestions.html";
            educationQAURL=RootPath+ "/bengali/education/33/8/categoryquestions.html";
            generalQAURL=RootPath+ "/bengali/general/others/177/8/categoryquestions.html";
            generalhealthQAURL=RootPath+ "/bengali/general-health-care/45/8/categoryquestions.html";
            break;
        case "9":
            qaURL=RootPath+ '/telugu/9/index.html';
            politicalQAURL=RootPath+ "/telugu/elections/89/9/categoryquestions.html";
            astrologyQAURL=RootPath+ "/telugu/astrology/182/9/categoryquestions.html";
            travelQAURL=RootPath+ "/telugu/international-destinations/39/9/categoryquestions.html";
            educationQAURL=RootPath+ "/telugu/education/6/9/categoryquestions.html";
            generalQAURL=RootPath+ "/telugu/general/others/30/9/categoryquestions.html";
            generalhealthQAURL=RootPath+ "/telugu/general-health-care/68/9/categoryquestions.html";
            break;
        case "10":
            qaURL=RootPath+ '/kannada/1/index.html';
            politicalQAURL=RootPath+ "/kannada/elections/89/10/categoryquestions.html";
            astrologyQAURL=RootPath+ "/kannada/astrology/178/10/categoryquestions.html";
            travelQAURL=RootPath+ "/kannada/international-destinations/39/10/categoryquestions.html";
            educationQAURL=RootPath+ "/kannada/education/60/10/categoryquestions.html";
            generalQAURL=RootPath+ "/kannada/general/others/31/10/categoryquestions.html";
            generalhealthQAURL=RootPath+ "/kannada/general-health-care/68/10/categoryquestions.html";
            break;
    } 
    
    objQA = document.getElementById('qa');
        if(objQA) objQA.href=qaURL;
    objpoliticalQA = document.getElementById('politicalQA');
        if(objpoliticalQA) objpoliticalQA.href=politicalQAURL;
    objastrologyQA = document.getElementById('astrologyQA');
        if(objastrologyQA) objastrologyQA.href=astrologyQAURL;
    objtravelQA = document.getElementById('travelQA');
        if(objtravelQA) objtravelQA.href=travelQAURL;
    objeducationQA = document.getElementById('educationQA');
        if(objeducationQA) objeducationQA.href=educationQAURL;
    objgeneralQA = document.getElementById('generalQA');
        if(objgeneralQA) objgeneralQA.href=generalQAURL;
    objgeneralhealthQA = document.getElementById('generalhealthQA')
        if(objgeneralhealthQA) objgeneralhealthQA.href=generalhealthQAURL;