/*'**************************************************************************************************
 *' Company   : Scepia Ltd.
 *' 
 *'*************************************************************************************************/
//****************************************************************************************************
//* A collection of functions.
//*
//* Written by: Kolik Mark
//***************************************************************************************************/
//var oDoc	= window.document;	
//var oAll	= window.document.all;	
//var oTbl	= window.document.getElementsByTagName("table");	
//var oHddn	= window.document.getElementsByTagName("INPUT");

var XMLDOM	= "Msxml2.DOMDocument";

//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	//window.document.onkeypress				= document_onEnterPress;
	if (document.addEventListener)
	{
		document.addEventListener("DOMContentLoaded", function(event) { init(event); }, false);
	}
	window.onload				= init;
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function init(evt)
{
	// quit if this function has already been called
	if (arguments.callee.done) return;

	// flag this function so we don't do the same thing twice
	arguments.callee.done = true;
  
	//if(init.active)
		//return;
	//init.active	= true;
	try
	{
		try	{ window.event.cancelBubble = true; }
		catch (exp) { evt.cancelBubble = true; }
		
//''''''''''''''''
/*		
		// show news 
//		showNews.filters		= ["progid:DXImageTransform.Microsoft.RandomDissolve();","progid:DXImageTransform.Microsoft.Iris(irisStyle='square', motion='out')"];
		showNews.filters		= ["progid:DXImageTransform.Microsoft.RandomDissolve();","progid:DXImageTransform.Microsoft.Iris(irisStyle='CIRCLE', motion='in')"];
		showNews.playTime		= [1.0,0.5];
		showNews.filterIndex	= 0;
		showNews.index			= 2;
		showNews(false);
*/		
//''''''''''''''''	

		var gm = document.getElementById("generalMain");
		var hs = document.getElementById("Header_searchString");
		multiColorMark(hs, gm);
		
		if(window.document.all.gridPlace)
		{
				multiColorMark(window.document.all.Header_searchString.value,window.document.all.gridPlace);
		}
		else	multiColorMark(window.document.all.Header_searchString.value,window.document.all.workPlace);
	
//''''''''''''''''	
		if(window._markerLoaded_) _markerLoaded_(window.document,3);
		
		if(window.document.all.menu_0) window.document.all.menu_0.className	= "noprint";
//''''''''''''''''	
		if(window.document.all.flashPlace)
		{
			var	xmlpath					= "../Homepage/GetFlash.XML.aspx";
			var xmlDoc					= new ActiveXObject("Msxml2.DOMDocument");
			var	root					= xmlDoc.createElement("content"); 
			var width					= screen.width;
				
			xmlDoc.appendChild(root);

			var	element					= xmlDoc.createElement("width");
				element.text			= width;

				root.appendChild(element);

//			alert(xmlDoc.xml);

			postXMLData(xmlpath, xmlDoc);
			
//			alert(window.result);
			
			var url						= window.result;

			if(url=="")
			{
				url						= "default.swf";
			}
			window.document.all.flashContainer.valign	= "top";
			
			var flash	 = "";
//				flash	+= '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="MenuPrimary" name="MenuPrimary" align="middle" VIEWASTEXT>';
				flash	+= '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="100%" height="100%" id="MenuPrimary" name="MenuPrimary" align="middle" VIEWASTEXT>';
				flash	+= '<param name="movie"             value="'+url+'" />';
				flash	+= '<param name="quality"			value="high" />';
				flash	+= '<param name="menu"              value="false" />';
				flash	+= '<param name="bgcolor"	        value="#ffffff" />';
				flash	+= '<param name="wmode"             value="transparent">';
				flash	+= '<param name="allowScriptAccess" value="sameDomain" />';
				flash	+= '</object>';
			
			window.document.all.flashPlace.innerHTML	= flash;
		}
//''''''''''''''''	
		window.focus();
	}
	catch(e){ws("init(event) "+e.description)}
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function printPage()
{
	window.print();
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function  onCheckBoxClick(o)
{
	switch(o.id)
	{
		case "products":	
		
			if(o.checked)
			{
				window.document.all.productsField3.checked	= true;
			}
			else
			{
				window.document.all.productsField1.checked	= false;
				window.document.all.productsField2.checked	= false;
				window.document.all.productsField3.checked	= false;
			}
			
		break;
		case "news":	
		
			if(o.checked)
			{
				window.document.all.newsField1.checked	= true;
			}
			else
			{
				window.document.all.newsField1.checked	= false;
				window.document.all.newsField2.checked	= false;
			}
		break;
	}
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function onRadioBoxClick(o)
{
	switch(o.name)
	{
		case "productsField":	window.document.all.products.checked	= true;	break;
		case "newsField":		window.document.all.news.checked		= true;	break;
	}
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function simpleSearch(mode)
{
	var url		= "";
	var srch	= "";
	
	var	srch1	= (!window.document.all.searchText)?"":window.document.all.searchText.value;		// simple search	(header)
	var	srch2	= (!window.document.all.searchText2)?"":window.document.all.searchText2.value;	// simple search	(form)
	var	srch3	= (!window.document.all.searchText3)?"":window.document.all.searchText3.value;	// advance search	(form)
	
	switch(mode)
	{
		case 1:		// simple search (header)
			srch	= srch1;
		break;
		case 2:		// simple search
		
			srch	= srch2;
		break;
		case 3:		// advance search
		
			srch	= srch3;
		break;
		default:	// [enter]
		
			srch	= !srch3?srch2:srch3;
			srch	= !srch?srch1:srch;
		break;
	}
	//alert(srch+"-"+srch2+"-"+srch3);
		
		if(!checkSearchIn(srch))	return;
	
		if(!srch3 || !isChecked())	// simple search
		{
			srch	 = toUrl(srch);
			url     = "/" + window.document.all.Header_searchFolder.value + "-" + window.document.all.Header_langURL.value + "/" ;
			url		+= "Search.aspx";
			//url		+= "?folderId="		+window.document.all.Header_searchFolder.value;
			url		+= "?searchText="	+srch;
		}
		else		// adv search
		{
			srch	 = toUrl(srch);
			//url		+= "?folderId="		+window.document.all.Header_advSearchFolder.value;
			url		= "/" + window.document.all.Header_advSearchFolder.value + "-" + window.document.all.Header_langURL.value + "/" 
			url		+= "AdvSearch.aspx";
			url		+= "?searchText="	+srch;
			url		+= "&products="		+getChecked("productsField");
			url		+= "&news="			+getChecked("newsField");
			url		+= "&events="		+(window.document.all.events.checked?1:0);
			url		+= "&other="		+(window.document.all.other.checked?1:0);
		}
		
		url = window.document.all.Header_baseURL.value + url;
		
		url2(url);
}

function url2(url)	{ urlTransfer(url);	}
function urlTransfer(url) { window.location	= url; }
function open2(url)		{	window.open(url,"newwin");		}
	
function ws(txt)		{	window.status	 = txt;			}
function wsa(txt)		{	window.status	+= txt+", ";	}

function loading()		{	ws("loading...");				}
function done()			{	ws("Done");						}
function saving()		{	ws("saving...");				}
function wait(ms)		{	var oI	= window.setInterval(loading,ms); window.clearInterval(oI);	}

//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function getChecked(oName)
{
	var collection	= document.getElementsByName(oName);
	
	for(var j=0; j<collection.length; j++)
	{
		if(collection[j].checked)	return j+1;
	}
									return 0;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function isChecked()
{
	if(window.document.all.products.checked)	return true;
	if(window.document.all.news.checked)		return true;
	if(window.document.all.events.checked)		return true;
	if(window.document.all.other.checked)		return true;
								return false;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function showNews(running)
{
	var newsFlash						= window.document.all.newsFlash;
		
	if(newsFlash)
	{
		if(!running)
		{
			running						= true;
		
			showNews.trs				= newsFlash.getElementsByTagName("TR");

			// set filter
			newsFlash.style.filter		= showNews.filters[showNews.filterIndex];
			newsFlash.filters[0].apply();
			
			
			// show/hide news
			if(showNews.filterIndex==0)
			{
				for(var j=0; j<showNews.trs.length; j++)	
				{ 
					if(showNews.trs[j].name)	none(showNews.trs[j]);
				}
												block(showNews.trs[showNews.index]);
				++showNews.index;
			}
			showNews.timeout			= showNews.playTime[showNews.filterIndex];
			
			// play filter	
			newsFlash.filters[0].play(showNews.timeout);

//			wsa(showNews.playTime[showNews.filterIndex]);	
			
			setIndex();
		}
	}
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function setIndex()
{
	++showNews.filterIndex;									
	
	if(showNews.index>showNews.trs.length-1)	showNews.index			= 2;	
	if(showNews.filterIndex>1)					showNews.filterIndex	= 0;
	
	window.document.all.newsFlash.onfilterchange		= "";
	
	showNews.t							= window.setTimeout(filterWait,5000); 
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function filterWait()
{
//	window.document.all.newsFlash.onfilterchange		= window.showNews;	
	
	window.clearTimeout(showNews.t);
	
	showNews(false);
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function sendForm()
{
	try
	{
		var sdDir = new SiteDictionary();
		//sendForm.sd = sdDir;
		
		if(onSendForm("form1"))		return;
		
		var data = {};
		var label = {};
		
	
		data.email2			= window.document.getElementsByTagName("INPUT").email2.value;
		label.email2		= "";
		
		data.productName	= window.document.getElementsByTagName("INPUT").productName.value;
		label.productName	= "";
	
		data.yourName		= window.document.getElementsByTagName("INPUT").yourName.value;
		label.yourName		= window.document.all.yourName_.innerText;
		
		data.organization	= window.document.getElementsByTagName("INPUT").organization.value;
		label.organization	= window.document.all.organization_.innerText;
		
		data.position		= window.document.getElementsByTagName("INPUT").position.value;
		label.position		= window.document.all.position_.innerText;
		
		data.country		= window.document.getElementsByTagName("INPUT").country.value;
		label.country		= window.document.all.country_.innerText;
		
		data.purpose		= window.document.getElementsByTagName("INPUT").purpose.value;
		label.purpose		= window.document.all.purpose_.innerText;
		
		data.priority		= window.document.all.priority.options[window.document.all.priority.selectedIndex].text;	//  window.document.all.priority.value;
		label.priority		= window.document.all.priority_.innerText;
		
		data.program		= window.document.all.program.options[window.document.all.program.selectedIndex].text;	// window.document.all.program.value;
		label.program		= window.document.all.program_.innerText;

		data.comments		= window.document.all.comments.value;
		label.comments		= window.document.all.comments_.innerText;
	
		data.contactPhone	= window.document.getElementsByTagName("INPUT").contactPhone.value;
		label.contactPhone	= window.document.all.contactPhone_.innerText;
		
		data.contactFax		= window.document.getElementsByTagName("INPUT").contactFax.value;
		label.contactFax	= window.document.all.contactFax_.innerText;
		
		data.contactEmail	= window.document.getElementsByTagName("INPUT").contactEmail.value;
		label.contactEmail	= window.document.all.contactEmail_.innerText;
		
		var element, xmlpath;
		
		var xmlDoc;
		if (window.ActiveXObject)
		{
			xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
			while (xmlDoc.readyState != 4) { }
		}
		else
		{
			if (document.implementation && document.implementation.createDocument)
			{
				xmlDoc = document.implementation.createDocument('', '', null);
			}
		}
		var root = xmlDoc.createElement("content"); 
	
		for(var e in data)
		{
			element = xmlDoc.createElement(e);
			var theText = xmlDoc.createTextNode(data[e]);
			element.appendChild(theText);
			element.setAttribute("label",label[e]);
			root.appendChild(element);
		}
		xmlDoc.appendChild(root);
		
		try
		{
			var serializer = new XMLSerializer();
			var xmlS = serializer.serializeToString(xmlDoc);
			//alert(xmlS);
        }
        catch (eee) { /*alert(xmlDoc.xml);*/ }
        
		xmlpath = "../INFO_REQUEST/Send.xml.aspx";

		//alert(xmlDoc.xml);

		postXMLData(xmlpath, xmlDoc);
		
		//alert(window.result);
		
		alert("Thank you for your application");
		
		window.history.back();
	}
	catch(e){ws("sendForm() "+e.description);}	
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function document_onEnterPress(e) 
{
	try
	{
		if(event.keyCode==13)
		{
		
			if(event.srcElement.tagName=="TEXTAREA")	return;
			event.cancelBubble		= true;
			event.returnValue		= false;
		
			switch(event.srcElement.id.toLowerCase())
			{
				case "searchtext":			// header search
					simpleSearch(1);
				break;
				case "simplesearch2":		// simple search
					simpleSearch(2);
				break;
				case "searchtext3":			// adv search
					simpleSearch(3);
				break;
				default:
					simpleSearch(4);
				break;
			}
		}
	}
    catch(ex)
    {
		e = e || window.event;
		var code = e.keyCode || e.which;
			
		if(code==13)
		{

			var srcEl = e.srcelement ? e.srcelement : e.target; 
			var node = (e.target) ? e.target : ((e.srcElement) ? e.srcElement : null);

			if(node.type=="TEXTAREA")	return;
			e.cancelBubble		= true;
			e.returnValue		= false;
			
			switch(node.id.toLowerCase())
			{
			
				case "searchtext":			// header search
					simpleSearch(1);
				break;
				case "simplesearch2":		// simple search
					simpleSearch(2);
				break;
				case "searchtext3":			// adv search
					simpleSearch(3);
				break;
				default:
					simpleSearch(4);
				break;
			}
		}
    }
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function document_onMouseDown()
{
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function f9(e)
{
	e = e || window.event;
	var code = e.keyCode || e.which;
	if(code==120)
	{
		try
		{
			if(nw)	nw.close();
		}
		catch(e){}
		
		nw	= window.open("","newwin");
		nw.document.write(document.documentElement.outerHTML);
		nw.focus();
	}
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function toUrl(srch)
{
	if(srch!="")	
	{
		srch		= srch.replace(/\+/gim,"%2B");
		srch		= srch.replace(/\|/gim,"%7C");
	}
	return	srch;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function checkSearchIn(searchtext)
{
	try
	{
		if(searchtext=="")												return false;
//		if(searchtext.length<2)									return false;
		
																		return true;
	}
	catch(e){ws("checkSearchIn() "+e.description)}
																		return false;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function inStr(forbidchars,instr)
{
	var arr	= forbidchars.split("");
	
	for(var j in arr){if(instr.indexOf(arr[j])>=0)			return true;}
															return false;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function getExtensionName(vle)
{
	var str = trim(vle);				if(str=="")			return "";
	var ind = str.lastIndexOf(".");
	var ext = str.substr(ind+1);		if(ext.length>5)	return "";
    
    return ext.toUpperCase();
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function visible(obj)
{
	if(obj) obj.style.visibility 	= "visible";	
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function hidden(obj)
{
	if(obj) obj.style.visibility	= "hidden";	
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function enable(obj)
{
	if(obj && obj.src)
	{
		obj.src			= obj.src.replace(/_dis\./gi,'_off.');
		obj.className	= obj.className.replace(/hand/gi,"");
		obj.className  += "hand";
	}
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function disable(obj)
{
	if(obj && obj.src)
	{
		obj.src			= obj.src.replace(/_off\./gi,'_dis.');
		obj.className	= obj.className.replace(/hand/gi,"");
	} 
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function isNone(obj)
{
	if(obj)
	{
		if(obj.style.display=="none")	return true;	
		else							return false;
	} 
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function none(o)
{
	if(o) o.style.display		= "none";	
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function block(o)
{
	if(o) o.style.display		= "block";	
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function blocknone(o)
{	
	try
	{
		if(o)
		{
			if(o.style.display && o.style.display=="block")
			{
					none(o);
			}	
			else	block(o);
		}
	}
	catch(e){ws("blocknone() "+e.description)}
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function imageOff(o)
{
	o.src		= o.src.replace(/_on\./gi,"_off.");
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function imageOn(o)
{
	o.src		= o.src.replace(/_off\./gi,"_on.");
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function imageOnOff(o)
{
	try
	{
		if(o && o.src)
		{
			if(o.src.indexOf("_on.")>0)
			{
					imageOff(o);
			}	
			else	imageOn(o);
		}
	}
	catch(e){ws("imageOnOff() "+e.description)}
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function classOff(o)
{
	o.className	= o.className.replace(/_on/gi,"_off");
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function classOn(o)
{
	o.className	= o.className.replace(/_off/gi,"_on");
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function queryString()
{
	var qs				= window.location.href;
	var templatePath	= "Templates";

	if(qs.indexOf("?")<0)	return "/"+templatePath;
	
	var arr				= qs.split("?")[1].split("&");
	
	this.querystring	= qs;
	this.obj			= {};
	
	for(var j=0; j<arr.length; j++)
	{
		if(!arr[j])					continue;
		if(trim(arr[j])=="")		continue;
	
		this.obj[arr[j].split("=")[0]]	= arr[j].split("=")[1];
	}
	
		arr				= qs.split(tml);
	
	this.url			= "/"+templatePath+arr[1];
	
}
//'''''''''''''
function queryStringprototypegetParameter(name)
{
	return this.obj[name];
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function CInt(vle,dflt)
{
    var str		= trim(vle);
    var strd	= trim(dflt);
    
	var intg	= parseInt(str,10);
	var intd	= parseInt(strd,10);
	
		intd	= (isNaN(intd)?0:intd);
    
	return (isNaN(intg)?intd:intg);
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function CStr(vle,dflt)
{
       dflt += "";
    if(dflt=="undefined") dflt = "";
    if(dflt=="null")      dflt = "";

       vle += "";
    if(vle=="undefined") return dflt;
    if(vle=="null")      return dflt;
    
    return vle;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function trim(vle)
{
        var trm = CStr(vle);
    return  trm.replace(/(^\s*)|(\s*$)/g, "");
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function trimEnd(vle,sep)
{
    var trm = trim(vle);
    var chr = trim(sep)==""?",":sep;

   if(trm=="")					return trm;
    
	var ln	= trm.length;
	
	if(trm.substr(ln)==chr)		return trm.substr(0,ln-1);
	else						return trm;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function cdata(str)
{
	return "<![CDATA["+trim(str)+"]]>";
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function obj(oData)
{
	try
	{	
		var arr		= [];
		
		for(var element in oData)
		{
			arr.push("<",element,">",oData[element],"</",element,">");	
		}
		//alert(arr.join(""));
	}
	catch(e){ws("obj() "+e.description); return "";}
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function getXMLDataAsync(xmlpath,async,htmpPlace,remark)
{
	try
	{
		loading();
		
		getXMLDataAsync.htmpPlace		= htmpPlace;
		getXMLDataAsync.remark			= remark;

			async						= async?async:true;	
	
		loading(xmlpath);
		
		var xmlDoc						= new ActiveXObject(XMLDOM);
			xmlDoc.onreadystatechange	= readyStateChange;
			xmlDoc.async				= async;

			xmlDoc.load(xmlpath);
	}
	catch(e){ws("getXMLDataAsync() error:"+e.description)}
	
	return;
	
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	function readyStateChange()
	{
		try
		{
			if(xmlDoc.readyState==4)	innerData();
		}
		catch(e){ws("readyStateChange() "+e.description);}
	}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	function innerData()
	{
		try
		{
			var err						= xmlDoc.parseError;

			if(err.errorCode != 0)	throw new Error(" error:"+err.reason);
			else					onAfterGetResult(xmlDoc);
		}
		catch(e){throw new Error("getXMLDataAsync.innerData() "+e.description);}
	}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
	function onAfterGetResult(xmlDoc)
	{
		done();
		
		try
		{
 			var node	= xmlDoc.selectSingleNode("/SPAN[@id='htmlPlace']");
  			
  			if(getXMLDataAsync.htmpPlace.tagName.toLowerCase()=="input")
  			{
  					// footer.ascx
  					getXMLDataAsync.htmpPlace.value		= node.text; 	
  					getXMLDataAsync.htmpPlace.remark	= getXMLDataAsync.remark; 	
  			}
  			else	getXMLDataAsync.htmpPlace.innerHTML	= node.text; 			
		}
		catch(e){throw new Error("onAfterGetResult() "+e.description);}
	}
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function postXMLData(xmlpath, xmldoc)
{
	try
	{
		loading();

		req = false;
		if(window.XMLHttpRequest && !(window.ActiveXObject))   // branch for native XMLHttpRequest object
		{
    		try { req = new XMLHttpRequest(); }
    		catch(e) { req = false; }
		
		}
		else if(window.ActiveXObject)	// branch for IE/Windows ActiveX version
		{
       		try { req = new ActiveXObject("Msxml2.XMLHTTP"); }
       		catch(e)
       		{ 
       			try { req = new ActiveXObject("Microsoft.XMLHTTP"); }
       			catch(e) { req = false; }
			}
		}
		if(req)
		{
			req.onreadystatechange = HandleStateChange;
			req.open("POST", xmlpath, false);
			req.setRequestHeader("Content-Type", "text/xml; charset='utf-8' ");
			req.send(xmldoc);
		}
	}
	catch (e){"postXMLData() "+ws("postXMLData() "+e.description);}
	
	//req = null;
}

//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function HandleStateChange()
{
	//alert(req.readyState);
	if(req.readyState==4)
	{
		window.result	= req.responseText;

		if(window.result)
		{
			if(window.result.toLowerCase().indexOf("error")>=0)
				ws("postXMLData.HandleStateChange() error: "+window.result);
			else												
				done();
		}
	}
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function getXMLData(xmlpath)
{
	try
	{
		ws(xmlpath);
		
		var xmldoc	= new ActiveXObject("Microsoft.XMLHTTP");

			xmldoc.Open("GET",xmlpath , false);
			xmldoc.Send();
		
		done();
			
			return xmldoc.responseText;	
	}
	catch(e){ws("getXMLData() "+e.description);};
}	
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function obj2xmldom(o)
{
	try
	{	
		var xmlDoc	= new ActiveXObject(XMLDOM);
		var	root	= xmlDoc.createElement("content"); 
		var element;
			
					  xmlDoc.appendChild(root);
			
		for(var e in o)
		{
			element	= xmlDoc.createElement(e);
					  element.text	= o[e];
					  root.appendChild(element);
		}
		return xmlDoc;
	}
	catch(e){ws("obj2xmldom() "+e.description);}
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function showPopUpTable(text,name)
{
	if(text=="")	return;
	
		showPopUpTable.width	= 200;
		showPopUpTable.height	= 150;

	showPopUp(popupHTML(text,name),window.event.x,window.event.y);
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function popupHTML(text,name)
{
	var explanation			= "border:solid 1 #004778;width:"+showPopUpTable.width+";height:"+showPopUpTable.height+";background-color:#ffffee;filter:progid:DXImageTransform.Microsoft.Alpha( opacity = 90 );padding:0 0 0 0;";
	var explanationImage	= "background-color:#81dcfe;border-bottom:solid 1 #004778;";
	var explanationClose	= "cursor:hand;border-top:solid 1 #004778;border-bottom:solid 1 #004778;width:15;float:right;";
	var explanationIn		= "padding:10 10 10 10;height:150;width:auto;color:#000000;font-family:Arial;font-size:11px;text-align:justify;vertical-align:top;";
		explanationIn	   += "SCROLLBAR-ARROW-COLOR:#ffffff;SCROLLBAR-FACE-COLOR:#68d6ff;SCROLLBAR-3DLIGHT-COLOR:#ebf4ff;SCROLLBAR-HIGHLIGHT-COLOR:#ebf4ff;SCROLLBAR-TRACK-COLOR:#ffffff;SCROLLBAR-SHADOW-COLOR:#ebf4ff;SCROLLBAR-DARKSHADOW-COLOR:#ebf4ff;width:100%;";
		explanationIn	   += "overflow-y:auto;overflow-x:hidden;";
	var explanationTitle	= "background-color:#81dcfe;border-bottom:solid 1 #004778;color:#004778;font-family:Arial;font-size:11px;text-decoration:none;font-weight:bold;height:25;padding-left:10;padding-right:10;";
	
	var	html	 =	'<TABLE dir="rtl" id="explanationTbl" style="'+explanation+'" cellpadding="0" cellspacing="0" border="0">';
		html	+=	'<TR height="25"><TD style="'+explanationImage+'"><IMG style="'+explanationClose+'" onclick="hidePopUp()" src="../Shared/Images/inside/button_on.gif" hspace="1" vspace="1" align="left"></TD><TD width="100%" id="explanationTitle" style="'+explanationTitle+'">'+name+'</TD></TR>';
		html	+=	'<TR><TD colspan="100%" valign="top"><DIV  id="explanationIn" style="'+explanationIn+'">'+text+'</DIV></TD></TR>';
		html	+=	'</TABLE>';

	return	html;
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function showPopUp(html,x,y)
{
		window.oPopup					= window.createPopup();
   
	var oPopBody						= window.oPopup.document.body;
		oPopBody.innerHTML				= html;
		oPopBody.document.hidePopUp		= hidePopUp;
		
		 window.oPopup.show(x, y, showPopUpTable.width, showPopUpTable.height+27, document.body);
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function hidePopUp()
{
	if(window.oPopup)
	{
		if(window.oPopup.isOpen)
		{
			window.oPopup.hide();
			window.oPopup=null;
		}
	}
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
function onLinkClick(url)
{
	if(window.document.all.bgSound)
	{
		window.document.all.bgSound.src	= "";
	}
	open2(url);
}
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
//''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

