﻿var nCustomerID = 0;
var sPassword = ""; 

function loginCustomer(strEmail, strPassword)
{
    returnObj('txtLoginPassword').obj.value="";

    sPassword = strPassword;  
    var strServiceURL =  location.protocol+"//"+location.hostname+"/ws/tcws.asmx/GetCustomer";

    var nBrokerID = readCookie("BrokerID");
    var strSessionID = readCookie("SessionGUID");

    var strParams = "BrokerID="+nBrokerID+"&SessionID="+strSessionID+"&Email="+strEmail+"&Password="+strPassword;
    ajaxPost(strParams,strServiceURL,"setCustomerFields");
}

function logoutCustomer()
{
    createCookie("CustomerID",0,0);
    eraseCookie("CustomerEmail");
    try{ /* only applies to checkout */
    returnObj("hidEmail").obj.value="";
    }catch(ex){/* carry on */}
 
   
    returnObj("divForgotPassword").style.display="none";
    returnObj("divAccountLogin").style.display="";
    returnObj("tdLoggedIn").obj.innerHTML="";
    returnObj("divAccountLogout").style.display="none";
        
    try /*these are specifically on the checkout page*/
    {
        returnObj("tblContactPrefs").style.display="";
        
        returnObj("divCCOptions").obj.innerHTML="";
        returnObj("divCCOptions").style.display="none";
        returnObj("rdoCC0").obj.checked=true;
    }
    catch(ex){/*carry on*/} 
        
    try /*these are specifically on the your account page*/
    {    
        returnObj("divAddressInfo").style.display="none";
        returnObj("divPreferences").style.display="none";
    }
    catch(ex){/*carry on*/}
   
    if(window.location.pathname.toString().substring(window.location.pathname.toString().lastIndexOf('/') + 1).toUpperCase()=="CHECKOUT.HTML")
    {
         positionFooterEx(2);
    } 
}

function setCustomerFields(xml)
{
    var bActiveX=true;
	if (document.implementation && document.implementation.createDocument)
	{
	    bActiveX=false;
		xmlDoc = document.implementation.createDocument("", "", null);
		parser=new DOMParser();
        xmlDoc=parser.parseFromString(xml,"text/xml");
	}
	else if (window.ActiveXObject)
	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.loadXML(xml);
 	}
	else
	{
		alert("Your browser is having problems with our website!\n\nPlease call us to resolve this issue.");
		return;
	}
	
    try /*these are specifically on the checkout page*/
    { 
        returnObj("selectReferral").obj.selectedIndex=0;
        returnObj("selectReferral").style.display="none";
        returnObj("chkJoinEmail").obj.checked="checked";
        returnObj("chkJoinMail").obj.checked="checked";
    }
    catch(ex){/*carry on*/} 

    switch(xmlDoc.getElementsByTagName("GetCustomer")[0].getAttribute("StatusCode"))
    {
        case "0":
            createCookie("CustomerID",xmlDoc.getElementsByTagName("GetCustomer")[0].getAttribute("ID"),0);
            createCookie("CustomerEmail",xmlDoc.getElementsByTagName("GetCustomer")[0].getAttribute("Email"),0);
            
            try{ /* only applies to checkout */
            returnObj("hidEmail").obj.value=xmlDoc.getElementsByTagName("GetCustomer")[0].getAttribute("Email");
            }catch(ex){/* carry on */}

            returnObj("divForgotPassword").style.display="none";
            returnObj("divAccountLogin").style.display="none";
            returnObj('txtLoginEmail').obj.value="";
            
            try{ /* only applies to checkout */
            returnObj("tblContactPrefs").style.display="none";
            returnObj("txtEmail").obj.value="";
            returnObj("tdLoggedIn").obj.innerHTML="<span style=\"color:#008800;\">"+readCookie("CustomerEmail")+"</span>";
            }catch(ex){/* carry on */}
            
            try{ /*these are specifically on the your account page*/
            returnObj("txtCurEmail").obj.value=readCookie("CustomerEmail");
            returnObj("divAddressInfo").style.display="";
            returnObj("tblContactPrefs").style.display="";
            returnObj("tdLoggedIn").obj.innerHTML="Logged in as <span style=\"color:#008800;\">"+readCookie("CustomerEmail")+"</span>";
            
            if (xmlDoc.getElementsByTagName("GetCustomer")[0].getAttribute("ReceiveEmail") == "True"){
                returnObj('chkJoinEmail').obj.checked=true;            
            }
            else{
                returnObj('chkJoinEmail').obj.checked=false;              
            }
            
            if (xmlDoc.getElementsByTagName("GetCustomer")[0].getAttribute("ReceiveMail") == "True"){
                returnObj('chkJoinMail').obj.checked=true;
            }
            else{
                returnObj('chkJoinMail').obj.checked=false;
            }
            }catch(ex){/*carry on*/} 
            
            returnObj("divAccountLogout").style.display="";
            
            returnObj("txtFirstName").obj.value=xmlDoc.getElementsByTagName("GetCustomer")[0].getAttribute("FirstName");
            returnObj("txtLastName").obj.value=xmlDoc.getElementsByTagName("GetCustomer")[0].getAttribute("LastName");
            returnObj("txtAddress1").obj.value=xmlDoc.getElementsByTagName("GetCustomer")[0].getAttribute("Address1");
            returnObj("txtAddress2").obj.value=xmlDoc.getElementsByTagName("GetCustomer")[0].getAttribute("Address2");
            returnObj("txtCity").obj.value=xmlDoc.getElementsByTagName("GetCustomer")[0].getAttribute("City");
            
            setCountryState(xmlDoc.getElementsByTagName("GetCustomer")[0].getAttribute("CountryID"),xmlDoc.getElementsByTagName("GetCustomer")[0].getAttribute("StateID"));
            
            returnObj("txtBillingPostalCode").obj.value=xmlDoc.getElementsByTagName("GetCustomer")[0].getAttribute("PostalCode");
            try{returnObj("hidBillingPostalCode").obj.value=xmlDoc.getElementsByTagName("GetCustomer")[0].getAttribute("PostalCode");}catch (ex){}
            
            returnObj("txtDayPhone").obj.value=xmlDoc.getElementsByTagName("GetCustomer")[0].getAttribute("DayPhone");
            returnObj("txtNightPhone").obj.value=xmlDoc.getElementsByTagName("GetCustomer")[0].getAttribute("NightPhone");
            
            nodeCCs=xmlDoc.getElementsByTagName("CreditCard");
            var strCCHTML = "";
            for(n=0; n<nodeCCs.length; n++)
            {
               strCCHTML += "<table id=\"tblCC" + nodeCCs[n].getAttribute("CCID").toString() + "\" cellpadding=\"5\" cellspacing=\"0\" class=\"tblCC\"><tr><td valign=\"top\" class=\"tdUseThisCard\"><table cellpadding=\"0\" cellspacing=\"0\"><tr><td valign=\"middle\" style=\"padding:2px;\"><input type=\"radio\" name=\"rdoCC\" id=\"rdoCC" + nodeCCs[n].getAttribute("CCID").toString() + "\" /></td><td valign=\"middle\"><label for=\"rdoCC" + nodeCCs[n].getAttribute("CCID").toString() + "\">use this card</label></td></tr></table></td><td valign=\"top\" class=\"tdCardType\"><table cellpadding=\"0\" cellspacing=\"0\"><tr><td valign=\"top\" style=\"padding:2px;\">" + nodeCCs[n].getAttribute("CCTypeName").toString() + "</td></tr></table></td><td valign=\"top\" class=\"tdNameOnCard\"><table cellpadding=\"0\" cellspacing=\"0\"><tr><td valign=\"top\" style=\"padding:2px;\">" + nodeCCs[n].getAttribute("CCHolderName").toString() + "</td></tr></table></td><td valign=\"top\" class=\"tdCardNumber\"><table cellpadding=\"0\" cellspacing=\"0\"><tr><td valign=\"top\" style=\"padding:2px;\">" + nodeCCs[n].getAttribute("CCNumber").toString() + "</td></tr></table></td><td valign=\"top\" class=\"tdExpiration\"><table cellpadding=\"0\" cellspacing=\"0\"><tr><td valign=\"top\" style=\"padding:2px;\" nowrap=\"nowrap\">" + nodeCCs[n].getAttribute("CCExpireMonth").toString() + "/" + nodeCCs[n].getAttribute("CCExpireYear").toString() + "</td></tr></table></td><td valign=\"top\" style=\"bacground-color:#ff00ff;\"><table cellpadding=\"0\" cellspacing=\"0\"><tr><td valign=\"top\" style=\"padding:2px;\"><input type=\"text\" id=\"txtCVV" + nodeCCs[n].getAttribute("CCID").toString() + "\" maxlength=\"4\" size=\"4\" /><div id=\"divErr_txtCVV" + nodeCCs[n].getAttribute("CCID").toString() + "\" class=\"divError\" style=\"display:none;\">&#160;</div></td></tr></table></td></tr></table>";
            }
            try{ /* only applies to checkout */
            returnObj("divCCOptions").obj.innerHTML=strCCHTML;
            returnObj("divCCOptions").style.display="";
            }catch(ex){/* carry on */}
            
            nCustomerID = xmlDoc.getElementsByTagName("GetCustomer")[0].getAttribute("ID");
            getRecentOrders(nCustomerID); //since we're already logged in//
            editPreference("NONE",nCustomerID,0,0,"",0);
            
            break;
            
        default:
            try{ /* only applies to checkout */        
            returnObj("txtEmail").obj.value=returnObj("txtLoginEmail").obj.value;
            alert("Failed to login!\n\nEither the email address or password you entered is not in our records.\n\nIf you forgot your password click the 'Forgot password' link and have a reminder emailed to you.\n\n- or -\n\nYou can continue to place your order without logging in, just fill out all the Contact Information fields.");
            }catch(ex)
            {
            
            alert("Failed to login!\n\nEither the email address or password you entered is not in our records.\n\nIf you forgot your password click the 'Forgot password' link and have a reminder emailed to you.\n\n");
            }
            returnObj('txtLoginPassword').obj.value="";
            break;
    }
    

    if(window.location.pathname.toString().substring(window.location.pathname.toString().lastIndexOf('/') + 1).toUpperCase()=="CHECKOUT.HTML")
    {
         positionFooterEx(2);
    } 
}


function preferenceSearch(CustomerID)
{
    if (returnObj("qPref").obj.value == "" || returnObj("qPref").obj.value == "find performers, venues, or cities")
    { return; }
    
    // check the radio buttons and set QueryType    
    var QueryType=0;
    if (returnObj("radioPerformer").obj.checked) {
        QueryType=2;
    }
    else if (returnObj("radioVenue").obj.checked) {
        QueryType=4;
    }
    else if (returnObj("radioCity").obj.checked) {
        QueryType=7;
    }   
    
    var strServiceURL =  location.protocol+"//"+location.hostname+"/ws/tcws.asmx/UpdateCustomerPreference";             
    var strParams = "strAction=NONE&nCustomerID="+CustomerID+"&nRTTID=0&nETID=0&strQuery="+returnObj("qPref").obj.value+"&nQueryType="+QueryType+"&bTransform=true";
    ajaxPost(strParams,strServiceURL,"renderPreferences");
}

function editPreference(strAction,CustomerID,ETID,RTTID,QueryString,QueryType)
{
    var strServiceURL =  location.protocol+"//"+location.hostname+"/ws/tcws.asmx/UpdateCustomerPreference";             
    var strParams = "strAction="+strAction+"&nCustomerID="+CustomerID+"&nRTTID="+RTTID+"&nETID="+ETID+"&strQuery="+QueryString+"&nQueryType="+QueryType+"&bTransform=true";
    ajaxPost(strParams,strServiceURL,"renderPreferences");
}

function renderPreferences(xml)
{
    var bActiveX=true;
	if (document.implementation && document.implementation.createDocument)
	{
	    bActiveX=false;
		xmlDoc = document.implementation.createDocument("", "", null);
		parser=new DOMParser();
        xmlDoc=parser.parseFromString(xml,"text/xml");
	}
	else if (window.ActiveXObject)
	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.loadXML(xml);
 	}
	else
	{
		alert("Your browser is having problems with our website!\n\nPlease call us to resolve this issue.");
		return;
	}
	
    try{ /* only applies to Your-Account */
    returnObj("divCustomerPreferences").obj.innerHTML=xml;
    returnObj("divCustomerPreferences").style.display="";
    }catch(ex){/* carry on */}
    filter_OnClick(readCookie("prefRadio"));
    //getRecentOrders(nCustomerID);  
    positionFooterEx(1);
}

function getRecentOrders(CustomerID)
{
    var strServiceURL =  location.protocol+"//"+location.hostname+"/ws/tcws.asmx/GetRecentOrders";             
    var strParams = "nCustomerID="+CustomerID+"&strPassword="+sPassword+"&bTransform=true";
    ajaxPost(strParams,strServiceURL,"renderOrders");
}

function renderOrders(xml)
{
    var bActiveX=true;
	if (document.implementation && document.implementation.createDocument)
	{
	    bActiveX=false;
		xmlDoc = document.implementation.createDocument("", "", null);
		parser=new DOMParser();
        xmlDoc=parser.parseFromString(xml,"text/xml");
	}
	else if (window.ActiveXObject)
	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.loadXML(xml);
 	}
	else
	{
		alert("Your browser is having problems with our website!\n\nPlease call us to resolve this issue.");
		return;
	}
	
    try{ /* only applies to Your-Account */
    returnObj("divOrderSummary").obj.innerHTML=xml;
    returnObj("divOrderSummary").style.display="";
    }catch(ex){/* carry on */}
    positionFooterEx(1);
}

function customerCat_onClick(RTTID,CustomerID,QueryString,QueryType)
{
    if (returnObj("chk_"+RTTID).obj.checked)
    {
        editPreference("ADD",CustomerID,0,RTTID,QueryString,QueryType);
    }
    else
    {    
        editPreference("REMOVE",CustomerID,0,RTTID,QueryString,QueryType);
    }   
}     

function sendPassword(strEmail)
{
    returnObj('txtLoginPassword').obj.value="";

    var strServiceURL =  location.protocol+"//"+location.hostname+"/ws/tcws.asmx/SendPasswordReminder";

    var nBrokerID = readCookie("BrokerID");

    var strParams = "BrokerID="+nBrokerID+"&Email="+strEmail;
    ajaxPost(strParams,strServiceURL,"sentPasswordMsg");
}

function sentPasswordMsg()
{
    returnObj('txtLoginEmail').obj.value=returnObj('txtReminderEmail').obj.value;
    returnObj('txtReminderEmail').obj.value="";
    returnObj("divForgotPassword").style.display="none";
    returnObj("divAccountLogin").style.display="";
    returnObj("divSentPwdMsg").style.display="";
    setTimeout("returnObj('divSentPwdMsg').style.display='none'",5000);
}

function loadStates(id,value)
{
    /* clear all the options that were previously set */
    while(returnObj(id).obj.options.length>0)
    {
         returnObj(id).obj.options[0]=null;
    }
   
    returnObj(id).obj.options[0] = new Option("",0); 
      
    var x;
    var i = 1; 
    for(x in strStates)
    {
        if(strStates[x].substring(0,strStates[x].indexOf(","))==value)
        {
            var strStateInfo = strStates[x].split(",");
            returnObj(id).obj.options[i] = new Option(strStateInfo[2],strStateInfo[1]);
            i++;
        }
    }

    if(i==1)
    {
        returnObj(id).style.display="none";
        returnObj("spanNO"+id).style.display="";
    }
    else
    {
        returnObj(id).style.display="";
        returnObj("spanNO"+id).style.display="none";
    }
   
    var strPostalInput = "txtBillingPostalCode";
    if(id.indexOf("Billing") == -1)
    {
        strPostalInput = "txtDeliveryPostalCode";
    }
    /* elseif needed for shipping field */

    if(strNoPostal.indexOf("|"+value+"|")>=0)
    {
        returnObj(strPostalInput).style.display="none";
        try{returnObj("spanNO"+strPostalInput).style.display="";}catch(ex) {}
    }
    else
    {
        returnObj(strPostalInput).style.display="";
        try{returnObj("spanNO"+strPostalInput).style.display="none";}catch(ex) {}
    }  
}

function setCountryState(nCountryID,nStateID)
{
    var x = 0;
    if(nCountryID!=0)
    {
        var nCountries = document.forms[0].selectBillingCountry.length;
        while(x < nCountries)
        {
            if(document.forms[0].selectBillingCountry.options[x].value==nCountryID)
            {
                 returnObj("selectBillingCountry").obj.options[x].selected=true;
                 x=nCountries;
            }
            x++;
        }
    }
    returnObj("selectBillingCountry").obj.onchange();
    
    if(nStateID!=0)
    {
        var nStates = document.forms[0].selectBillingState.length;
        x=0;
        while(x < nStates)
        {
            if(document.forms[0].selectBillingState.options[x].value==nStateID)
            {
                 returnObj("selectBillingState").obj.options[x].selected=true;
                 x=nStates;
            }
            x++;
        }
    }
    try{returnObj("hidBillingState").obj.value=nStateID;}catch(ex) {}
}


function updateCustomer_OnClick(SessionID,BrokerID)
{
    if (returnObj("txtCurEmail").obj.value=="")
    {
    returnObj("trCurEmailErr").style.display="";
    return; /*don't process w/ a blank email*/
    }
    var strPwd="";
    if ((returnObj("txtPassword1").obj.value != "") && (returnObj("txtPassword2").obj.value != ""))
    {
        if (returnObj("txtPassword1").obj.value == returnObj("txtPassword2").obj.value)
            strPwd=returnObj("txtPassword1").obj.value;
    }
    returnObj('divSettingsUpdateMsg').style.display="";  
    createCookie("CustomerEmail",returnObj("txtCurEmail").obj.value,0);
    createCookie("StateID",returnObj("selectBillingState").obj.options.selectedIndex,0);
    createCookie("CountryID",returnObj("selectBillingCountry").obj.options.selectedIndex,0);
    
    var emailChecked="false";
    var mailChecked="false";           
    if (returnObj('chkJoinEmail').obj.checked == true){ emailChecked="true"; }    
    if (returnObj('chkJoinMail').obj.checked == true){ mailChecked="true"; }
        
    var strServiceURL =  location.protocol+"//"+location.hostname+"/ws/tcws.asmx/UpdateCustomer";             
    var strParams = "&strSessionID="+SessionID+"&nBrokerID="+BrokerID+"&nCustomerID="+readCookie("CustomerID")+"&strFirstName="+returnObj("txtFirstName").obj.value+"&strLastName="+returnObj("txtLastName").obj.value+"&strAddress1="+returnObj("txtAddress1").obj.value+"&strAddress2="+returnObj("txtAddress2").obj.value+"&strCity="+returnObj("txtCity").obj.value+"&nCountryID="+returnObj("selectBillingCountry").obj.options[returnObj("selectBillingCountry").obj.options.selectedIndex].value+"&nStateID="+returnObj("selectBillingState").obj.options[returnObj("selectBillingState").obj.options.selectedIndex].value+"&strPostal="+returnObj("txtBillingPostalCode").obj.value+"&strPhoneDay="+returnObj("txtDayPhone").obj.value+"&strPhoneEve="+returnObj("txtNightPhone").obj.value+"&bEmailList="+emailChecked+"&bMailList="+mailChecked+"&strEmail="+returnObj("txtCurEmail").obj.value+"&strNewPassword="+strPwd+"&bTransform=true";
    ajaxPost(strParams,strServiceURL,"renderAccountSettings");
}

function renderAccountSettings(xml)
{
    var bActiveX=true;
	if (document.implementation && document.implementation.createDocument)
	{
	    bActiveX=false;
		xmlDoc = document.implementation.createDocument("", "", null);
		parser=new DOMParser();
        xmlDoc=parser.parseFromString(xml,"text/xml");
	}
	else if (window.ActiveXObject)
	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.loadXML(xml);
 	}
	else
	{
		alert("Your browser is having problems with our website!\n\nPlease call us to resolve this issue.");
		return;
	}
	
    returnObj("divAccountSettings").obj.innerHTML=xml;
    returnObj("divAccountSettings").style.display="";
    setTimeout("returnObj('divSettingsUpdateMsg').style.display='none'", 5500); 
    
    /* these are safe to call since this can't get called without being logged in */
    try{ 
    returnObj('selectBillingCountry').obj.options.selectedIndex=readCookie("CountryID");    
    returnObj("selectBillingCountry").obj.onchange();
    returnObj('selectBillingState').obj.options.selectedIndex=readCookie("StateID");    
    }catch(ex){}
}

function filter_OnClick(id,customerID)
{            
    switch(id)
    {
    case "Perf":
        try{
        returnObj("radioPerformer").obj.checked = true;
        returnObj("radioVenue").obj.checked = false;
        returnObj("radioCity").obj.checked = false;
        createCookie("prefRadio","Perf",0);
        } catch (ex) {}
    break;
    case "Venue":
        try{
        returnObj("radioPerformer").obj.checked = false;
        returnObj("radioVenue").obj.checked = true; 
        returnObj("radioCity").obj.checked = false;
        createCookie("prefRadio","Venue",0);
        } catch (ex) {}
    break;
    case "City":
        try{
        returnObj("radioPerformer").obj.checked = false;
        returnObj("radioVenue").obj.checked = false;
        returnObj("radioCity").obj.checked = true;
        createCookie("prefRadio","City",0);
        } catch (ex) {}
    break;
    }   
     
}

function redirectToSpecials(PageName)
{
    window.location.href= "http://" + document.domain + PageName;
}

function trackFedEx(strRef)
{
    if (returnObj("div" + strRef).style.display == "none")
    { 
        var strServiceURL =  location.protocol+"//"+location.hostname+"/ws/tcws.asmx/GetFedexTracking";
        var strParams = "strTrackingNumber="+strRef; 
        ajaxPost(strParams,strServiceURL,"renderFedEx");
     }
     else
     {
        returnObj("div" + strRef).style.display ="none";
        positionFooterEx(1);
     }
}

var strRowBegin = "<tr class=\"rowEven\">"; 
function renderFedEx(xml)
{
    var bActiveX=true;
	if (document.implementation && document.implementation.createDocument)
	{
	    bActiveX=false;
		xmlDoc = document.implementation.createDocument("", "", null);
		parser=new DOMParser();
        xmlDoc=parser.parseFromString(xml,"text/xml");
	}
	else if (window.ActiveXObject)
	{
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.loadXML(xml);
 	}
	else
	{
		alert("Your browser is having problems with our website!\n\nPlease call us to resolve this issue.");
		return;
	}
	
	var iSteps = parseFloat(xmlDoc.getElementsByTagName("FedEx_TrackStatus")[0].getAttribute("steps")); 
	var strTrackingNumber = xmlDoc.getElementsByTagName("FedEx_TrackStatus")[0].getAttribute("TrackingNumber"); 
	var strTableBegin = "<table class=\"fedExTracking\" cellpadding=\"0\" cellspacing=\"0\">";
	var strRowCellBegin = "<td align=\"left\" width=\"25%\">"; 
	var strRowEnd = "</td></tr>"; 
	var strTableCell = "</td><td align=\"left\" width=\"25%\">";
	var strTableEnd = "</table>"; 
	var strHeaderRow = "<tr style=\"background: #CCCC00;\"><td width=\"25%\"><u>Date/Time</u>" + strTableCell + "<u>Activity</u>" + strTableCell + "<u>Location</u>" + strTableCell + "<u>Details</u>" + strRowEnd; 
	var sb = new StringBuilder(); 
	
	for (var i = 0; i < iSteps; i++) 
	{
	    sb.append(strRowBegin); 
	    sb.append(strRowCellBegin); 
	    sb.append(xmlDoc.getElementsByTagName("Step_" + i)[0].getAttribute("Date"));
	    sb.append(strTableCell + xmlDoc.getElementsByTagName("Step_" + i)[0].getAttribute("Status"));
	    sb.append(strTableCell + xmlDoc.getElementsByTagName("Step_" + i)[0].getAttribute("Location"));
	    sb.append(strTableCell + xmlDoc.getElementsByTagName("Step_" + i)[0].getAttribute("Description")); 
	    sb.append(strRowEnd); 
	    
        toggleRowClass();
	}
	var s = strTableBegin +  strHeaderRow + sb.toString() + strTableEnd; 
	returnObj("div" + strTrackingNumber).obj.innerHTML = s;
	returnObj("div" + strTrackingNumber).style.display = "";
	positionFooterEx(1); 
}

function toggleRowClass()
{
    if (strRowBegin == "<tr class=\"rowEven\">")
    {
        strRowBegin = "<tr class=\"rowOdd\">"; 
    }
    else
    {
        strRowBegin = "<tr class=\"rowEven\">";
    }   
}