/*
 *Integrate with Omniture SiteCatalyst features
 *This function should be used by search modules exclusively>
 */
 

function pageNaming() {
	pageURL = document.URL;

	//Post Pages has been taken cared of in the post scripts

	//Post Confirmation page
	if (pageURL.match("q=eolconfirm") && pageURL.match("mode=conf_post")) {
		s.pageName= "Post_Confirmation";         
	
	//Search Page has been taken cared of in the search scripts  

	//Landing Pages 
	} else if (pageURL.match('\/p\/landing\/buyer\.html')) {
		s.pageName="Landing_Buyer";
	} else if (pageURL.match('\/p\/landing\/provider\.html')) {
    	s.pageName="Landing_Provider";
	} else if (pageURL.match('\/p\/corporate\/community\/resource-center')) {
	    s.pageName="Landing_ResourceCenter";
	} else if (pageURL.match('\/p\/help\/index\.html')) {
	    s.pageName="Landing_Help";
		
	//MyElance Pages
	} else if (pageURL.match('myelance\.pl\?')) {	

		//MyElance Buyer Activity Pages
		if (pageURL.match("state=buying") && pageURL.match("folder=Inbox")) {
	    	s.pageName="MyElance_Buyer_Activity";
	
		//My Elance Provider Activity Pages
		} else if (pageURL.match("state=selling")) {
	    	s.pageName="MyElance_Provider_Activity";	

		//The rest of My Elance pages 
		} else {
			 s.pageName="MyElance";
		}

		//My Elance Account Pages 
	} else if (pageURL.match('Account\.pl\?')) {

		//My Elance Account Transaction Histroy Pages
		if (pageURL.match("mode=comp_trans")) {
			 s.pageName="MyElance_Account_TransHistory";

		//The rest of  Account Pages
		} else {
			 s.pageName="MyElance_Account";
		}
		
		//My Elance Preference Pages 
	} else if (pageURL.match('preferences.pl\?')) {
		s.pageName="MyElance_Preferences";

	// All other pages by default
	} else {
	    s.pageName=pageURL;
	}																														
	 
	sSC();
}


function sPost(stage) {

	switch(stage) {
		case 1: //Called in post.js
		    s.pageName="Post_Describe";
			break;    
		case 2: //Called in reg.js
			s.pageName="Post_Reg_Activation";
			break;
		case 3:  //called in post.js
			s.pageName="Post_Preview";
			break;
		default:
			s.pageName= "Post_Related";
	}

	sSC();

}

function sProjSearch() {
	s.pageName="Search_Projects";
	s.prop1=document.getElementById('matchKeywords').value;                	//prop1
							
	//alert(document.getElementById('totalresults_placeholder').innerHTML.split(/\s/g)[6]);
	s.prop2=document.getElementById('totalresults_placeholder').innerHTML.split(/\s/g)[6];	//prop2
									 	
	s.prop3=document.getElementById('timeleftFilter').value;                //prop3
	s.prop4=document.getElementById('timelistedFilter').value;              //prop4
	s.prop5=document.getElementById('budgetFilter').value;           		//prop5
	s.prop6=document.getElementById('projtypeFilter').value;                //prop6
	s.prop7=document.getElementById('escrowprojectFilter').checked;        	//prop7
	s.prop8=document.getElementById('statusFilter').value;                  //prop8
	s.prop15=document.getElementById("matchType").value;                	//prop15

    s.eVar10=document.getElementById('matchType').value;                    //eVar10
	s.eVar13=document.getElementById('timeleftFilter').value;               //prop13
	s.eVar14=document.getElementById('timelistedFilter').value;             //prop14
	s.eVar15=document.getElementById('budgetFilter').value;            		//prop15
	s.eVar16=document.getElementById('projtypeFilter').value;               //prop16
	s.eVar17=document.getElementById('escrowprojectFilter').checked;        //prop17
	s.eVar18=document.getElementById('statusFilter').value;                 //prop18															
	sSC();
}
	
function sProfSearch() {
	//alert(document.getElementById('totalresults_placeholder').innerHTML.split(/\s/g)[6]);                  
	s.pageName="Search_Profiles";

	s.prop1=document.getElementById('matchKeywords').value;                	//prop1
	s.prop2=document.getElementById('totalresults_placeholder').innerHTML.split(/\s/g)[6];	//prop2
    s.prop15=document.getElementById("matchType").value;                   //prop15

    s.eVar10=document.getElementById('matchType').value;                   	//eVar10
	
	sSC();
}

function sContactInfo() {
	s.events="event12";   //View Info Button
	sSC();
}

function sContactMe() {
	s.events="event18";   //Contact me Button
	sSC();
}


function sContactToInvite() {
	s.events="event19";   //Contact To Invite Button
	sSC();
}

function sContactToChat() {
	s.events="event20";   //Contact to chat Button
	sSC();
}

function sContactToCall() {
	s.events="event21";   //Contact to call Button
	sSC();
}

function sSC() {
	 /************* DO NOT ALTER ANYTHING BELOW THIS LINE ! **************/
	 var s_code=s.t();if(s_code)document.write(s_code)
}
