/******************************************************************************************
													
							begin                : SAT 30 AUG 2008
							programmer           : SLIM
							module               : Chat-For Partnesrs
							pseudo code          : None
							version              : 1.0~
					
*****************************************************************************************/
//This file is included by partners to allow them to use our online support
//the required parameters are :
// auth_code: the authentication code given to client uppon sign in
// serviceUrl: this is the url used to call the web service NB:THE URL MUST NOT CONTAIN THE FULL PATH TO WEBSERVICE

function call_support(auth_code , serviceUrl)
{
	
	if(document.getElementById('345') == null){
		
		random_n = new String (Math.random()); 
		random_n = random_n.substring(2,11);
		
		/*scrpt = document.createElement('script');
		scrpt.src = serviceUrl+'/chat/partners/view_online_support.php?'+
					'n='+random_n+'&authcode='+auth_code;
		scrpt.type = "text/javascript";
		scrpt.id = 345;
		document.body.appendChild(scrpt); // ie 6 bug: when using script tags file will be cached (stupid microsoft).
		*/
		frm = document.createElement('iframe');
		frm.src = serviceUrl+'/chat/partners/view_online_support.php?'+
					'n='+random_n+'&authcode='+auth_code;
		frm.style.display = "none";
		frm.id = 345;
		document.body.appendChild(frm);
		
	}else{
		scrpt = document.getElementById('345');
		document.body.removeChild(scrpt);
		call_support(auth_code , serviceUrl);
		}
}
