//****************************************************************************
//Copyright (C) 2005 iSupporter, All Rights Reserved.
//The following Code is subject to all restrictions on
//such code as contained in the End User License Agreement accompanying
//this product.
//****************************************************************************
//<script>
/**
 * is iSupporter online assistant open?
 */
 
 /**
Hafss_Chat - iSupporter Live Support Script <a href="http://isupporter.com" title="Live support by iSUpporter" style="color:#5817AF; text-decoration:none;">iSupporter Online Assistant&#8482;</a><br>
<br>
<a href="http://isupporter.com" title="Live support by iSUpporter" style="color:#5817AF; text-decoration:none;">iSupporter Online Assistant&#8482;</a> is a live interactive communication & co-browsing tool created for customers that need to communicate with clients that browse their website. This tool helps people find links and information on a website quickly using a the iSupporter web application along with a real assistant on the backend.
<br>
<br>
Using this tool, we guarantee, that your clients will be satisfied with your business online, giving each customer the opportunity to have a real person greet them and walk them through any questions they may have, in turn helping with overall sales and professionalism to your company?s image.
<br>
<br>
The <a href="http://isupporter.com" title="Live support by iSUpporter" style="color:#5817AF; text-decoration:none;">iSupporter Online Assistant&#8482;</a> application is a server-based live interactive messaging system which can connect users (both assistants and visitors) together for helping and assisting purposes. Without installing any additional software/plug-in you can start using <a href="http://isupporter.com" title="Live support by iSUpporter" style="color:#5817AF; text-decoration:none;">iSupporter Online Assistant&#8482;</a> as a Visitor or an Assistant, you can make your online business grow, giving rich content online customer support.
<br>
<br>
Think about <a href="http://isupporter.com" title="Live support by iSUpporter" style="color:#5817AF; text-decoration:none;">iSupporter Online Assistant&#8482;</a> as a website add-on tool that simply helps.  
  */

var is_prot = window.document.location["protocol"];
try {
var iSupporterAssistant = false;
var iSupporter = 
	(top.document.location.href.indexOf('_isupporter') != -1 
		|| top.document.location.href.indexOf('AssComunicator') != -1
		|| top.document.location.href.indexOf('oaComunicator') != -1);
		
iSupporterAssistant = ( top.document.location.href.indexOf('AssComunicator') != -1
		|| top.document.location.href.indexOf('oaComunicator') != -1);	

}

catch(e) {
	//alert(e.description);
	iSupporter = true;
	iSupporterAssistant = true;
}	



//alert("iSupporter: " + iSupporter + " Assistant:" + iSupporterAssistant);

function is_Root(ipro) {
	
	var loc = top.document.location;
	var pro = loc["protocol"];
	var hos = loc["host"];
	hos='isupporter.com/client'	
	if(ipro) 
		pro = ipro;
	
	return pro+"//"+hos;
}	


	var isUniqueID = "61da50cf63";
document.iSupporterJSLoaded = (isUniqueID)?true:false;
		
//BEGIN buzz module
var isessionid_cookie_name = "isessionid_262";

var isessionid = getCookie(isessionid_cookie_name);  

if(!isessionid) isessionid = 0;

var ipageJustChanged = true;

var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;

function createAlert() {
	if(iSupporter) {
		//alert("You are in Isupporter Online Assistant");
		return false;
	}	
	
	var params = "?";
	params += "isUniqueID="+isUniqueID;
		
	params += "&language=default";

document.write('<sc'+'ript>');
document.write('function isupporter_buzz_DoFSCommand(command, args) {');
document.write('	var clientObj = isInternetExplorer ? document.all.isupporter_buzz : document.isupporter_buzz;');
document.write('	if(command == "isupporter_closeAlert") { isupporter_closeAlert();	}');
document.write('	else if (command == "isupporter_showAlert") { isupporter_showAlert();  }');
document.write('}');
document.write('</sc'+'ript>');
			
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<sc'+'ript language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub isupporter_buzz_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call isupporter_buzz_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</sc'+'ript\>\n');
}

document.write("<div id=\"iSupporterConfirmation\" style=\"width: "+(document.body.clientWidth - 30)+"; !important; height: "+(document.body.offsetHeight - 30)+"; !important; position: absolute; left: 0; top: 0; z-index: 101; visibility: hidden;\" >");

document.write("<table width=\"100%\" height=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">");
document.write("<tr height=100% width=\"100%\"><td height=\"100%\" align=\"center\" valign=\"middle\">");
document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\""+is_prot+"//fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=286 height=140 id=\"isupporter_buzz\" align=\"middle\">");
document.write("<param name=\"allowScriptAccess\" value=\"allways\" />");
document.write("<param name=\"movie\" value=\"http://isupporter.com/buzz.swf"+params+"\" />");
document.write("<param name=\"wmode\" value=\"transparent\">");
document.write("<param name=\"quality\" value=\"high\" />");
document.write("<param name=\"bgcolor\" value=\"#ffffff\" />");
document.write("<embed src=\"http://isupporter.com/buzz.swf"+params+"\" quality=\"high\" bgcolor=\"#ffffff\" width=300 height=160 name=\"isupporter_buzz\" align=\"middle\" wmode=\"transparent\" allowScriptAccess=\"allways\" type=\"application/x-shockwave-flash\" pluginspage=\""+is_prot+"//www.macromedia.com/go/getflashplayer\" />");
document.write("</object>");
document.write("</td></tr></table>");	
document.write("</div>");
}

function deleteWhosOnline(sid) {
	var woc = document.getElementById("isupporter_whos_online_container");	
	if(woc)
		woc.innerHTML = "";
}

function createWhosOnline(sid) {
//alert('no whos online'); 
	return true;}


function closeAlert() {
	document.getElementById("iSupporterConfirmation").style.visibility="hidden";
}
isupporter_closeAlert = closeAlert;

function isCenterElement(elul) {
	if (document.all) {
		height_ = document.documentElement.offsetHeight - 30;
		width_  = document.documentElement.offsetWidth - 30;
		scrollw_ = 10;
	}
	else {
		height_ = window.innerHeight - 30;
		width_  = window.innerWidth - 30;	

		scrollw_ = 8;
	}
	
	scrTop = document.body.scrollTop + document.documentElement.scrollTop;
	scrLeft = document.body.scrollLeft + document.documentElement.scrollLeft;
	
	
	move_ = document.getElementById(elul);

	newtop = height_/2 - (move_.clientHeight / 2) -scrollw_ + scrTop;
	eval('move_.style.top = "' + newtop + 'px"');
	
	newleft = width_/2 - (move_.clientWidth / 2) - scrollw_ + scrLeft;
	eval('move_.style.left = "' + newleft + 'px"');	
}

function showAlert() {
		//debugger;
	if(!isInternetExplorer) {
	//debugger;
	document.getElementById("iSupporterConfirmation").style.width = window.innerWidth - 5;
	document.getElementById("iSupporterConfirmation").style.height = window.innerHeight - 5;
	} else {
	document.getElementById("iSupporterConfirmation").style.width = document.documentElement.offsetWidth - 5;
	document.getElementById("iSupporterConfirmation").style.height = document.documentElement.offsetHeight - 5;	
	}
		if(!isInternetExplorer) {
	//document.getElementById("iSupporterConfirmation").style.left = (screen.availWidth/2+286/2 - document.body.scrollLeft) + "px";
	//document.getElementById("iSupporterConfirmation").style.top = (screen.availHeight/2+140/2 - document.body.scrollTop) +"px";	

	//document.getElementById("iSupporterConfirmation").style.top = "150pt";	
	} else {
	//document.getElementById("iSupporterConfirmation").style.left = document.documentElement.scrollLeft;
	//document.getElementById("iSupporterConfirmation").style.top = document.documentElement.scrollTop;	
	}
	
	isCenterElement("iSupporterConfirmation");
	
	document.getElementById("iSupporterConfirmation").style.visibility="visible";
}
isupporter_showAlert = showAlert;

function Buzz() {
	openIsupporterClientButon("normal");
	showAlert();
}

function iPinged(insessionid) {
	//alert(insessionid);
	isessionid = insessionid;
	
	setCookie(isessionid_cookie_name, isessionid);
	
	//set the isession id for buton. (to prevent entering in assisted mode without isessionid)
	// in buton if we don't have isession id wait until we get it
	if(window.document.isupporter_buton) {
		window.document.isupporter_buton.SetVariable("isessionid", isessionid);
		//window.document.isupporter_buton.TCallFrame("/", 2);		
	}	
}
//END buzz module


//BEGIN root javascript protoype changes for isupporter compatibility
function is_write(inul) {
	//alert(is_write);
	this.old_write("<!-- BIS -->"+inul+"<!-- EIS -->");
}

function is_createElement(inul) {
	//alert(is_createElement);
	var elementul = this.old_createElement(inul);
	var v = "new";
	elementul.iSupporter = ""+v+"";
	return elementul;
}

/**
 * if iSupporter online assistant open apply the root javascript changes
 *
 * for this to work fine this js has to be included in the head section and in front of any other javascript tags
 * needed whe i.e. HMenu is used on the site pages
 *
 */
if(iSupporter) {
	document.old_write = document.write;
	document.write = is_write;

	document.old_createElement = document.createElement;
	document.createElement = is_createElement;
}
//END root javascript protoype changes for isupporter compatibility
	
//BEGIN functions used for opening and showing the isupporter online assistant
function Asked() {
	document.iSupporterQuestion = document.ASK.question.value;
	openClient(document.ASK.question.value);
}
function AskedIsupporter() {
	document.iSupporterQuestion = document.ASK.question.value;
	//openClient(document.ASK.question.value);
	openIsupporterClientButon();
}

function openIsupporterClientButon(tipul, mesaj, target) {
	//isupporter_showAlert();
	//isupporter_closeAlert();
	if(window.document.isupporter_buton) {
		if(tipul && tipul=="popupBlocker") {
			window.document.isupporter_buton.setVariable("popmesaj", mesaj);
			window.document.isupporter_buton.setVariable("poptarget", target);
			window.document.isupporter_buton.TCallFrame("/", 2);
		}	
		else if(tipul && tipul=="normal") {
			window.document.isupporter_buton.TCallFrame("/", 3);
		}
		else {	
			window.document.isupporter_buton.TCallFrame("/", 1);
		}	
	}		
	//return "trilulilu";
}

function is_popupOpened_Focus() {
	var resultat = false;
	try {
		if(self.top.opener && self.top.opener.name=="iSupporterPopedWindow_262") {
			resultat = true;
			self.top.opener.window.focus();
		}
		else if(self.opener && self.opener.name=="iSupporterPopedWindow_262") {
			resultat = true;
			self.opener.window.focus();
		}
		else if(window.opener && window.opener.name=="iSupporterPopedWindow_262"){
			resultat = true;
			self.opener.window.focus();
		}
	}
	catch(e) {
		//alert(e.description);
	}		
	return resultat;
}

function is_popupOpened() {
	iSupporterPopedWindow = "true";
	setCookie("iSupporterPopedWindow", iSupporterPopedWindow);
	deleteWhosOnline(262);
	createWhosOnline(262);
}

function isFormAddElement(f, name, value) {
	var el;
	el = document.createElement("INPUT");
	el.type = "hidden";
	el.name = name;
	el.value = ""+value;
	f.appendChild(el);
}

function isFormAndSubmit(fclient, fquestion, fisessionid, flocation) {
	var f = document.createElement("FORM");
	f.action = ""+is_Root()+"/_isupporter_262/";
	f.name = "is_form";
	f.method = "POST";
	f.target = "_top";
	document.appendChild(f);
	isFormAddElement(f, "client", fclient);
	isFormAddElement(f, "question", fquestion);
	isFormAddElement(f, "isessionid", fisessionid);
	isFormAddElement(f, "location", flocation);
	f.submit();
}

var waitingIsessionIDMax = 5;
var waitingIsessionIDCount = 0;
var waitingIsessionTimerID = 0;

var waitingAudio = null;
var waitingQuestion = null;
var waitingLanguage = null;

var waitingIsessionStop = false;

function isCantOpen(in_isessionid) {
	var pkm = (2);
	
	return (pkm>=3) && (in_isessionid == "0");	
}

function waitingIsessionID() {
	if(waitingIsessionTimerID) {
		clearTimeout(waitingIsessionTimerID);
		waitingIsessionTimerID = 0;
	}
	
	waitingIsessionIDCount++;
	
	if(!isCantOpen(isessionid)) {
		return openClient(waitingAudio, waitingQuestion, waitingLanguage);
	}
	
	if(waitingIsessionIDCount > waitingIsessionIDMax) {
		waitingIsessionStop = true;
		return openClient(waitingAudio, waitingQuestion, waitingLanguage);
		//return;
	}	
	
	//alert(waitingIsessionIDCount);
		
	waitingIsessionTimerID = setTimeout(new Function("waitingIsessionID()"), 500);
}
	
function openClient(audio, question, language) {
	

	var pk = (2);
	var pkm = (2);
	
	if(isCantOpen(isessionid)) {
		if(!waitingIsessionStop) {
			waitingIsessionIDCount = 0;
		
			waitingAudio = audio;
			waitingQuestion = question;
			waitingLanguage = language;
		
			waitingIsessionTimerID = setTimeout(new Function("waitingIsessionID()"), 500);
			return;	
		}
		waitingIsessionStop = false;
	}
	

	
	var cobrow = (window.ActiveXObject);
	//var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
	//sw
	switch(pk) {
		case 1:
			
		break;
		case 2:
			if(!audio)
				pk = 1;
		break;
		case 3:
			
		break;
		case 4:
			if(!audio)
				pk = 3;
		break;
		case 5:
			if(!cobrow)
				pk = 3;
		break;
		case 6:
			if(!cobrow)
				if(audio)
					pk = 4;
				else
					pk = 3;
			else
				if(!audio)
					pk = 5;
		break;
		default:
			pk = 1;
	}
	//pk = 4;
	
	switch(pkm) {
		case 1:
			
		break;
		case 2:
			if(!audio)
				pkm = 1;
		break;
		case 3:
			
		break;
		case 4:
			if(!audio)
				pkm = 3;
		break;
		case 5:
			if(!cobrow)
				pkm = 3;
		break;
		case 6:
			if(!cobrow)
				if(audio)
					pkm = 4;
				else
					pkm = 3;
			else
				if(!audio)
					pkm = 5;
		break;
		default:
			pkm = 1;
	}
	//alert(pkm);
	//pkm = 4;	
	
	//force package adunat
	if(document.isupporterForcedPKS)
		pk = document.isupporterForcedPKS;
		
	if(document.isupporterForcedPKA && cobrow)
		pk = document.isupporterForcedPKA;
	//alert(pk);
			
	var popup = !(pk >= 5);
	var is_language = "default";
	
	if(iSupporter) {
		//alert("You are in Isupporter Online Assistant");
		return false;
	}	
	
	if(!question)
		if(document.iSupporterQuestion)
			question = document.iSupporterQuestion;
	
	//var quu = (question > "")?'client=1&question='+escape(question)+'|'+pk+:'client=1|'+pk+'';
	var quu = 'client=1&question=';
	var fquestion = ((question>"")?escape(question):"")+'|'+pk+','+pkm;
	fquestion += (is_language>"")?("."+escape(is_language)):"";
	quu += fquestion;
	
	var fisessionid = isessionid;
	var sess = "&isessionid="+fisessionid;
	
	var sid = 262;	
	var locs = document.location;
	if(sid==14 && false) {
		locs = parent.document.location;
	}
	else if(cobrow) {
		locs = parent.document.location;
		var fs = parent.document;
		if(fs) {
			for(i=0; i<fs.frames.length; i++) {
				locs += "|" + fs.frames[i].location;
			}
		}
	}

	top.stopBeforeClosing = true;
	var TheQSHtm;
	TheQSHtm = "?"+quu+sess+"&location="+locs;
	
	if(popup) { 
		if(is_popupOpened_Focus()) {
			//alert("deja");
			return true;
		}
		else {
			//return;
			

			iSupporterPopupWindow = window.open(is_Root()+"/_isupporter_262/"+TheQSHtm, "iSupporterPopedWindow_262","status=1,directories=0,dependent=0,height="+310+",width="+445+",hotkeys=0,location=0,menubar=0,resizable=0,screenX=30,screenY=30,scrollbars=1,titlebar=1,toolbar=0");
			if(iSupporterPopupWindow) {
				try {
					self.opener = iSupporterPopupWindow;
					self.top.opener = iSupporterPopupWindow;
					
					iSupporterPopupWindow.moveTo(100,100);	
					iSupporterPopupWindow.window.focus();

					//window.opener = iSupporterPopupWindow.window;
				}
				catch(e) {
					//alert(e.description);
				}
				
				is_popupOpened();
				
				//return true;
			}
			else { //popup blocker
				//alert("Please Disable popup blocker!");
				openIsupporterClientButon("popupBlocker", is_Root()+"/_isupporter_262/"+TheQSHtm, "iSupporterPopedWindow_262");
				//return true;
			}	
		}
	}	
	else { 
		site_id = "262";
		if(true || site_id=="8")
			//old_get
			window.open(is_Root()+"/_isupporter_262/"+TheQSHtm, "_top");
		else 
			isFormAndSubmit(1, fquestion, fisessionid, locs);				
		//return true;
	}
		
}
function openIsupporterClient() {
	openIsupporterClientButon();
}

//var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
function isupporter_buton_DoFSCommand(command, args) {
	var clientObj = isInternetExplorer ? document.all.isupporter_buton : document.isupporter_buton;
	if (command == "isupporter_showAlert") { isupporter_showAlert();  }
	else if(command == "isupporter_closeAlert") { isupporter_closeAlert();	}
}

function showIsupporter(hide, question) {
	
	if(question && question>"")
		document.iSupporterQuestion =  question;
		
	var sid = 262;	
	if(document.iSupporterShowTimerID) {
	    clearTimeout(document.iSupporterShowTimerID);
	    document.iSupporterShowTimerID  = 0;
	}
	else {
		createAlert();
		showItIsupporter(hide);
		
		document.write("<span id=isupporter_whos_online_container>");	
		document.write("</span>");
		document.iSupporterShowTimerIDCount = 0;
	}
	//alert(document.readyState);
	if((document.readyState!="complete" && document.all) && !iSupporter) {
		document.iSupporterShowTimerIDCount += 1;
		if(document.iSupporterShowTimerIDCount == 100) {
			//return;
		}
		else {
			document.iSupporterShowTimerID = setTimeout(new Function("showIsupporter("+((hide)?"true":"false")+")"), 150);		
			return;
		}	
	}
	createWhosOnline(sid);

	isupporterForcedPKS = getCookie("isupporterForcedPKS");
	if(isupporterForcedPKS) {
		if(is_scazut(isupporterForcedPKS)) {
			deleteCookie("isupporterForcedPKS");
			isupporterForcedPKS = null;
			document.isupporterForcedPKS = null;
		}
	}
}

function showItIsupporter(hide) {
	var sid = 262;
	//createAlert();		
	if(!iSupporter) {
		//document.write("<a href='#' onclick='openIsupporterClient()'>Online Assistant</a>");
		var params = "?";
		params += "site_id="+262;
		params += "&script="+escape("http://isupporter.com/buton.php");
		params += "&isUniqueID="+isUniqueID;
		params += "&isessionid="+isessionid;
		//params += "&domain="+"hafss.com";
		params += "&domain="+ top.document.location["host"];
		params += "&whos="+"false";
		
		params += "&language=default";		params += "&bturl="+escape("http://www.hafss.com/Images/up1/support.jpg");
		
		var dimensiuni = " width=\"103\" height=\"47\"";
		dimensiuni = " width=\"103\" height=\"47\"";
			//	if(hide)	dimensiuni = " width=\"1\" height=\"1\"";
		

document.write('<sc'+'ript>');
document.write('function isupporter_buton_DoFSCommand(command, args) {');
document.write('	var clientObj = isInternetExplorer ? document.all.isupporter_buton : document.isupporter_buton;');
document.write('	if (command == "isupporter_showAlert") { isupporter_showAlert();  }');
document.write('}');
document.write('</sc'+'ript>');

			
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<sc'+'ript language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub isupporter_buton_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call isupporter_buton_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</sc'+'ript\>\n');
}

document.write("<span>");			
document.write("<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">");
document.write("<tr><td>");
document.write("<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\""+is_prot+"//fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" "+dimensiuni+" id=\"isupporter_buton\" align=\"middle\">");
document.write("<param name=\"allowScriptAccess\" value=\"allways\" />");
document.write("<param name=\"movie\" value=\"http://isupporter.com/buton.swf"+params+"\" />");
//document.write("<param name=\"movie\" value=\""+read_buton+params+"\" />");
document.write("<param name=\"wmode\" value=\"transparent\">");
document.write("<param name=\"quality\" value=\"high\" />");
document.write("<param name=\"bgcolor\" value=\"#ffffff\" />");
document.write("<embed src=\"http://isupporter.com/buton.swf"+params+"\" quality=\"high\" bgcolor=\"#ffffff\" "+dimensiuni+" name=\"isupporter_buton\" wmode=\"transparent\" align=\"middle\" allowScriptAccess=\"allways\" type=\"application/x-shockwave-flash\" pluginspage=\""+is_prot+"//www.macromedia.com/go/getflashplayer\" />");			
document.write("</object>");


document.write("</td></tr>");
	
if(!hide) {
document.write("<tr><td nowrap>");
document.write("<a href=\"\" style=\"font-family:Arial; font-size:9px; color: #777777; text-decoration: none;\" target=_blank title=\"\"></a>");document.write("</td></tr>");
}

document.write("</table>");
document.write("</span>");			
	}
}
//END functions used for opening and showing the isupporter online assistant

function is_adunat() {
	
	document.isupporterForcedPKA = 6;
	openClient("true", "+");
	if(iSupporterPopupWindow) {
		iSupporterPopupWindow.close();
		iSupporterPopupWindow = null;
	}	
	return 12345;
}


function is_scazut(pk) {
	document.isupporterForcedPKS = pk;
	openClient("true", "-");
	return true;
}

//BEGIN Cookies funcitons
/**
 * Sets a Cookie with the given name and value.
 *
 * name       Name of the cookie
 * value      Value of the cookie
 * [expires]  Expiration date of the cookie (default: end of current session)
 * [path]     Path where the cookie is valid (default: path of calling document)
 * [domain]   Domain where the cookie is valid
 *              (default: domain of calling document)
 * [secure]   Boolean value indicating if the cookie transmission requires a
 *              secure transmission
 */
function setCookie(name, value, expires, path, domain, secure)
{
    document.cookie= name + "=" + escape(value) +
        ((expires) ? "; expires=" + expires.toGMTString() : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

/**
 * Gets the value of the specified cookie.
 *
 * name  Name of the desired cookie.
 *
 * Returns a string containing value of specified cookie,
 *   or null if cookie does not exist.
 */
function getCookie(name)
{
    var dc = document.cookie;
    var prefix = name + "=";
    var begin = dc.indexOf("; " + prefix);
    if (begin == -1) {
        begin = dc.indexOf(prefix);
        if (begin != 0) return null;
    } 
	else {
        begin += 2;
    }
    var end = document.cookie.indexOf(";", begin);
    if (end == -1) {
        end = dc.length;
    }
   
    return unescape(dc.substring(begin + prefix.length, end));
}

/**
 * Deletes the specified cookie.
 *
 * name      name of the cookie
 * [path]    path of the cookie (must be same as path used to create cookie)
 * [domain]  domain of the cookie (must be same as domain used to create cookie)
 */
function deleteCookie(name, path, domain)
{
    if (getCookie(name)) {
        document.cookie = name + "=" + 
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}
//END Cookies funcitons

//BEGIN other debug functions
function degObj(aObj) {
	if(!aObj)
		return null;
	var sir = '';
	for(var list in aObj) {
		var val = aObj[list];
		if(!val)
			continue;
		sir += list+"="+val+'\n';	
	}
	alert(sir);
}
//END other debug functions

