

function changemenu(p) {
    for (i = 1; i <= 1; i++) {
        if (p == "p" + i + "") {
            document.getElementById("tab" + i + "").className = "m_motor_active"
            document.getElementById("block" + i + "").style.display = 'block';
        }
        else {
            document.getElementById("tab" + i + "").className = "m_motor_inactive";
            document.getElementById("block" + i + "").style.display = 'none';
        }
    }
}

function changemouse(p) {
    for (i = 1; i <= 1; i++) {
        if (p == "p" + i + "") {
            document.getElementById("tab" + i + "").className = "m_motor"
            document.getElementById("block" + i + "").style.display = 'none';
        }
        else {
            //document.getElementById("tab"+i+"").className="tab_inactive"
            document.getElementById("block" + i + "").style.display = 'none';

        }
    }
}
function changeride(r) {
    for (i = 1; i <= 1; i++) {
        if (r == "r" + i + "") {
            document.getElementById("ride" + i + "").className = "m_ride_active"
            document.getElementById("blockride" + i + "").style.display = 'block';
        }
        else {
            document.getElementById("ride" + i + "").className = "m_ride_inactive";
            document.getElementById("blockride" + i + "").style.display = 'none';
        }
    }
}

function changeridehover(r) {
    for (i = 1; i <= 1; i++) {
        if (r == "r" + i + "") {
            document.getElementById("ride" + i + "").className = "m_ride"
            document.getElementById("blockride" + i + "").style.display = 'none';
        }
        else {
            document.getElementById("blockride" + i + "").style.display = 'none';
        }
    }
}
function changecommunity(s) {
    for (i = 1; i <= 1; i++) {
        if (s == "s" + i + "") {
            document.getElementById("community" + i + "").className = "m_community_active"
            document.getElementById("blockcommunity" + i + "").style.display = 'block';
        }
        else {
            document.getElementById("community" + i + "").className = "m_community_inactive";
            document.getElementById("blockcommunity" + i + "").style.display = 'none';
        }
    }
}

function changecommunityhover(s) {
    for (i = 1; i <= 1; i++) {
        if (s == "s" + i + "") {
            document.getElementById("community" + i + "").className = "m_community"
            document.getElementById("blockcommunity" + i + "").style.display = 'none';
        }
        else {
            document.getElementById("blockcommunity" + i + "").style.display = 'none';
        }
    }
}

function changecompany(x) {
    for (i = 1; i <= 1; i++) {
        if (x == "x" + i + "") {
            document.getElementById("company" + i + "").className = "m_company_active"
            document.getElementById("blockcompany" + i + "").style.display = 'block';
        }
        else {
            document.getElementById("company" + i + "").className = "m_company_inactive";
            document.getElementById("blockcompany" + i + "").style.display = 'none';
        }
    }
}

function changecompanyhover(x) {
    for (i = 1; i <= 1; i++) {
        if (x == "x" + i + "") {
            document.getElementById("company" + i + "").className = "m_company"
            document.getElementById("blockcompany" + i + "").style.display = 'none';
        }
        else {
            document.getElementById("blockcompany" + i + "").style.display = 'none';
        }
    }
}

function changeradio(pp, names) {
    for (i = 1; i <= 2; i++) {
        if (pp == "p" + i + "") {
            document.getElementById("radio" + i + "").className = "radio_on"
            document.getElementById("types").value = names;
        }
        else {
            document.getElementById("radio" + i + "").className = "radio_off";
        }
    }
}


function change_blk(s) {
    for (i = 1; i <= 6; i++) {
        if (s == "s" + i + "") {
            document.getElementById("mov" + i + "").className = "tab_select_in";
            document.getElementById("block1" + i + "").style.display = 'block';
        }
        else {
            document.getElementById("mov" + i + "").className = "tab_unselect_in";
            document.getElementById("block1" + i + "").style.display = 'none';
        }
    }
}

function tech_blk(t) {
    for (i = 1; i <= 7; i++) {
        if (t == "t" + i + "") {
            document.getElementById("tec" + i + "").className = "tab_select_in2";
            document.getElementById("block1" + i + "").style.display = 'block';
        }
        else {
            document.getElementById("tec" + i + "").className = "tab_unselect_in2";
            document.getElementById("block1" + i + "").style.display = 'none';
        }
    }
}

function my_ride_blk(t) {
    for (i = 1; i <= 2; i++) {
        if (t == "t" + i + "") {
            document.getElementById("my" + i + "").className = "my_select_in";
            document.getElementById("block1" + i + "").style.display = 'block';
        }
        else {
            document.getElementById("my" + i + "").className = "my_unselect_in";
            document.getElementById("block1" + i + "").style.display = 'none';
        }
    }
}

function my_ride_blk2(u) {
    for (i = 1; i <= 3; i++) {
        if (u == "u" + i + "") {
            document.getElementById("dforum_rid" + i + "").className = "my_select_in2";
            document.getElementById("dforum_block11" + i + "").style.display = 'block';
        }
        else {
            document.getElementById("dforum_rid" + i + "").className = "my_unselect_in2";
            document.getElementById("dforum_block11" + i + "").style.display = 'none';
        }
    }
}

function event_blk(u) {
    for (i = 1; i <= 15; i++) {
        if (u == "u" + i + "") {
            document.getElementById("event" + i + "").className = "event_select_in";
            document.getElementById("block1" + i + "").style.display = 'block';
        }
        else {
            document.getElementById("event" + i + "").className = "event_unselect_in";
            document.getElementById("block1" + i + "").style.display = 'none';
        }
    }
}

//---------------------------------------------------------------------------------------
    //    Page                : Motorcycle/Default.aspx
    //    Date Created        : 23-12-2010 12:20 PM
    //    Date Last Modified  : 
    //    Author              : P.Saravanan
    //    Purpose             : Calling Ajax For tab Menu
    //                          
    //   ---------------------------------------------------------------------------------------

function tech_blk1(t, modelid, specid, count) {

    for (i = 0; i <= count - 1; i++) {
        if (t == "t" + i + "") {
            document.getElementById("tec" + i + "").className = "tab_select_in2";
        }
        else {
            document.getElementById("tec" + i + "").className = "tab_unselect_in2";
        }
    }
    var oXmlHttp = zXmlHttp.createRequest();
    var params = "r=" + Math.random() + "&specid=" + specid + "&modelid=" + modelid;
    oXmlHttp.open("POST", "loadspecdetails.aspx", true);
    oXmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    oXmlHttp.setRequestHeader("Content-length", params.length);
    oXmlHttp.setRequestHeader("Connection", "close");
    oXmlHttp.onreadystatechange = function () {
        if (oXmlHttp.readyState == 4) {
            //alert(oXmlHttp.responseText);
            document.getElementById("specdetail").innerHTML = oXmlHttp.responseText;
            window.scroll(300, 300);
        }
    }
    document.getElementById("specdetail").innerHTML = "&nbsp;&nbsp;&nbsp;<img src='../images/ajax-loader.gif'>";
    oXmlHttp.send(params);
}


function rd_login_unloginuser_rate(bikemodel) {
    window.location = "../login/login.aspx?model=" + bikemodel + "&ride=1";
}

function rd_login_unloginuser_ratedelar(delarid) {
    window.location = "../login/login.aspx?delar=" + delarid + "&ride=1";
}


function IsEmpty(obj) {
    var objValue;
    objValue = obj.value.replace(/\s+$/, "");
    if (objValue.length == 0)
    { return true; }
    else { return false; }
}


function chec_txt() {
    if (document.getElementById("Emailid").value == "") {
        //document.getElementById("emailerrormessage").innerHTML="Enter Email Id";
        document.getElementById("chkusr").innerHTML = "Enter Email Id";
        document.getElementById("Emailid").focus();
        return false;
    }
    if (document.getElementById("Emailid").value != "") {
        if (document.getElementById("Emailid").value.match(/[a-zA-Z0-9]+\@[a-zA-Z0-9-]+(\.(a-zA-Z0-9]{2}|[a-zA-Z0-9]{2}))+/) == null) {
            document.getElementById("chkusr").innerHTML = "Enter Valid Email Id";
            document.getElementById("Emailid").value = ""
            document.getElementById("Emailid").focus();
            return false;
        }
    }

    if (document.getElementById("User_Password").value == "") {
        document.getElementById("chkusr").innerHTML = "Enter Password";
        document.getElementById("Emailid").focus();
        return false;
    }
}

function showlogin1()
 {
    if (document.getElementById("show_loginbox").style.display == 'block') 
    {
       document.getElementById("show_loginbox").style.display = 'none';
        document.getElementById("sign_head").className = "loginoff";
    }
    else 
    {
       document.getElementById("sign_head").className = "loginshow";
        document.getElementById("show_loginbox").style.display = 'block';
    }
    return true;
}



function showlogin(url) {

    if (document.getElementById("show_loginbox").style.display == 'block') {
        document.getElementById("show_loginbox").style.display = 'none';
        document.getElementById("sign_head").className = "loginoff";
    }
    else {
        document.getElementById("sign_head").className = "loginshow";
        document.getElementById("show_loginbox").style.display = 'block';
    }
    if (document.getElementById("txtEmailid").value == "") {
        //document.getElementById("lchkusr").innerHTML = "Enter Email Id";
        document.getElementById("txtEmailid").focus();
        return false;
    }
    if (document.getElementById("txtUser_Password").value == "") {
        //document.getElementById("lchkusr").innerHTML = "Enter Password";
        document.getElementById("txtUser_Password").focus();
        return false;
    }
    if (document.getElementById("txtEmailid").value != "") {
        var emailid = document.getElementById("txtEmailid").value;
        var passwords = document.getElementById("txtUser_Password").value;
        document.location.href = "../login/chkuser.aspx?email=" + emailid + "&uspassword=" + passwords + "&url=" + url;
        return false;
    }
}

function gototriviapage(var1) {
    window.location = "ride101.aspx?index=" + var1
}

function cleartriviastory() {
    document.getElementById("txt_title").value = "";
    document.getElementById("txt_story").value = "";
    document.getElementById("FileUpload1").value = "";
    document.getElementById("FileUpload2").value = "";
    document.getElementById("FileUpload3").value = "";
    document.getElementById("txtCaptcha").value = "";
    return false;
}

function triviastoryformvalidation() {
    if (document.getElementById("txt_title").value == "") {
        document.getElementById("showerror").style.display = 'block';
        document.getElementById("txt_title_error").innerHTML = "Enter Title";
        document.getElementById("txt_title").focus();
        return false;
    }
    if (document.getElementById("txt_story").value == "") {
        document.getElementById("showerror").style.display = 'block';
        document.getElementById("txt_title_error").innerHTML = "Enter Story";
        document.getElementById("txt_story").focus();
        return false;
    }
    if (document.getElementById("txtCaptcha").value == "") {
        document.getElementById("showerror").style.display = 'block';
        document.getElementById("txt_title_error").innerHTML = "Enter Captcha Text";
        document.getElementById("txtCaptcha").focus();
        return false;
    }
}

function showimg(val) {
    document.getElementById("bigimage").src = "../image/TriviadetailsImage/" + val;
}

function trivia_login_unloginuser_comment(tid) {
    window.location = "../login/login.aspx?trid=" + tid + "&tridetails=tridetailss"
}
function trivia_login_unloginuser_comment_storyoftheweek(tid) {
    window.location = "../login/login.aspx?trid=" + tid + "&storyofweek=storyofweeks"
}

function trides_login_unloginuser_jointhisdiscussion(rid) {
    window.location = "../login/login.aspx?trid=" + rid + "&jointhisdiscussion=join"
}

function trides_login_unloginuser_createthisdiscussion(rid) {
    window.location = "../login/login.aspx?trid=" + rid + "&createthisdiscussion=create"
}
function trides_login_unloginuser_abusethisdiscussion(rid) {
    window.location = "../login/login.aspx?trid=" + rid + "&abusethisdiscussion=abuse"
}

function gototriviadetailpage(var1, rid) {
    window.location = "rides-details.aspx?rid=" + rid + "&index=" + var1
}
function rides_login_unloginuser_uploadwallpaper() {
    window.location = "../login/login.aspx?wall=1"
}
function popitup(url) {
newwindow=window.open(url);
}
function gotocommunity(var1) {
    window.location = "community.aspx?type=bullet&index=" + var1
}

function gotopost(var1) {
    window.location = "posts.aspx?index=" + var1
}
function postlogin()
{
window.location="../login/login.aspx";
}
function postpagelogin(id,tid) {
    window.location = "../login/login.aspx?pg=posts&id=" + id + "&topicid=" + tid;
}

function showimg1(val, width, height) {
    document.getElementById("bigimage").src = "../image/TriviadetailsImage/" + val;
    document.getElementById("bigimage").style.height = height + "px";
    document.getElementById("bigimage").style.width = width + "px";
}
