function string_unique()
{
	string_date = new Date();
	string = string_date.getFullYear()+""+string_date.getMonth()+""+string_date.getDate()+""+string_date.getHours()+""+string_date.getMinutes()+""+string_date.getSeconds()+""+string_date.getTime();
	return(string);
}
function getUserBrowser(includeVersion)
{
	var userBrowser = "";
	var userBrowserAndVersion = "";
	if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent))//test for Firefox/x.x or Firefox x.x (ignoring remaining digits);
	{ 
		var ffversion=new Number(RegExp.$1) // capture x.x portion and store as a number
		if (ffversion>=4)
		{userBrowser = "ff"; userBrowserAndVersion = "ff3";} //document.write("You're using FF 3.x or above")
		else if (ffversion>=3)
		{userBrowser = "ff"; userBrowserAndVersion = "ff3";} //document.write("You're using FF 3.x or above")
		else if (ffversion>=2)
		{userBrowser = "ff"; userBrowserAndVersion = "ff2";} //document.write("You're using FF 2.x")
		else if (ffversion>=1)
		{userBrowser = "ff"; userBrowserAndVersion = "ff1";} //document.write("You're using FF 1.x")
		else
		{userBrowser = "ff"; userBrowserAndVersion = "ffX";} //document.write("n/a")
	}
	else if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)) //test for MSIE x.x;
	{ 
		var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
		if (ieversion>=9)
		{userBrowser = "ie"; userBrowserAndVersion = "ie9";} //document.write("You're using IE8 or above")
		else if (ieversion>=8)
		{userBrowser = "ie"; userBrowserAndVersion = "ie8";} //document.write("You're using IE8 or above")
		else if (ieversion>=7)
		{userBrowser = "ie"; userBrowserAndVersion = "ie7";} //document.write("You're using IE7.x")
		else if (ieversion>=6)
		{userBrowser = "ie"; userBrowserAndVersion = "ie6";} //document.write("You're using IE6.x")
		else if (ieversion>=5)
		{userBrowser = "ie"; userBrowserAndVersion = "ie5";} //document.write("You're using IE5.x")
		else
		{userBrowser = "ie"; userBrowserAndVersion = "ieX";} //document.write("n/a")
	}
	else if (/Opera[\/\s](\d+\.\d+)/.test(navigator.userAgent)) //test for Opera/x.x or Opera x.x (ignoring remaining decimal places);
	{ 
		var oprversion=new Number(RegExp.$1) // capture x.x portion and store as a number
		if (oprversion>=10)
		{userBrowser = "op"; userBrowserAndVersion = "op10";} //document.write("You're using Opera 10.x or above")
		else if (oprversion>=9)
		{userBrowser = "op"; userBrowserAndVersion = "op9";} //document.write("You're using Opera 9.x")
		else if (oprversion>=8)
		{userBrowser = "op"; userBrowserAndVersion = "op8";} //document.write("You're using Opera 8.x")
		else if (oprversion>=7)
		{userBrowser = "op"; userBrowserAndVersion = "op7";} //document.write("You're using Opera 7.x")
		else
		{userBrowser = "op"; userBrowserAndVersion = "opX";} //document.write("n/a")
	}
	else if (/Chrome[\/\s](\d+\.\d+)/.test(navigator.userAgent)) //test for Chrome/x.x 
	{ 
		var oprversion=new Number(RegExp.$1) // capture x.x portion and store as a number
		if (oprversion>=4)
		{userBrowser = "ch"; userBrowserAndVersion = "ch4";} //document.write("You're using Opera 10.x or above")
		else if (oprversion>=3)
		{userBrowser = "ch"; userBrowserAndVersion = "ch3";} //document.write("You're using Opera 9.x")
		else if (oprversion>=2)
		{userBrowser = "ch"; userBrowserAndVersion = "ch2";} //document.write("You're using Opera 8.x")
		else if (oprversion>=1)
		{userBrowser = "ch"; userBrowserAndVersion = "ch1";} //document.write("You're using Opera 7.x")
		else
		{userBrowser = "ch"; userBrowserAndVersion = "chX";} //document.write("n/a")
	}
	if(includeVersion)
		return userBrowserAndVersion;
	else
		return userBrowser;
}
function print_r(theObj)
{
	if(theObj.constructor == Array ||
			theObj.constructor == Object){
		document.write("<ul>")
		for(var p in theObj){
			if(theObj[p].constructor == Array||
					theObj[p].constructor == Object){
				document.write("<li>["+p+"] => "+typeof(theObj)+"</li>");
				document.write("<ul>")
				print_r(theObj[p]);
				document.write("</ul>")
			} else {
				document.write("<li>["+p+"] => "+theObj[p]+"</li>");
			}
		}
		document.write("</ul>")
	}
}
function getObjectX(obj)
{
	var curleft = 0;
	if(obj.offsetParent)
	while(1)
	 {
		curleft += obj.offsetLeft;
		if(!obj.offsetParent)
		break;
		obj = obj.offsetParent;
	}
	else if(obj.x)
	curleft += obj.x;
	return curleft;
}
function getObjectY(obj)
{
	var curtop = 0;
	if(obj.offsetParent)
	while(1)
	{
		curtop += obj.offsetTop;
		if(!obj.offsetParent)
		break;
		obj = obj.offsetParent;
	}
	else if(obj.y)
	curtop += obj.y;
	return curtop;
}
function getScrollX()
{
	var scrOfX = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfX = window.pageXOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfX = document.body.scrollLeft;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfX = document.documentElement.scrollLeft;
	}
	return scrOfX;
}
function getScrollY()
{
	var scrOfY = 0;
	if( typeof( window.pageYOffset ) == 'number' ) {
		//Netscape compliant
		scrOfY = window.pageYOffset;
	} else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
		//DOM compliant
		scrOfY = document.body.scrollTop;
	} else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
		//IE6 standards compliant mode
		scrOfY = document.documentElement.scrollTop;
	}
	return scrOfY;
}
function getPageWidth()
{
	var myWidth = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		//myWidth = document.documentElement.clientWidth;
		myWidth = document.documentElement.clientWidth;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
	}
	return myWidth;
}
function getPageHeight()
{
	var myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		//myHeight = document.documentElement.clientHeight;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myHeight = document.body.clientHeight;
	}
	return myHeight;
}
function Creat_Options(select_id,array,emptytype)
{
	//alert(array);
	var slt = document.getElementById(select_id);
	if( array.length != 0 )
	{
		if( emptytype != 1 )
		{
			if( slt.options.length != 0 )
			j = slt.options.length;
			else
			j = 0;
		}
		else
		{
			j = 0;
			slt.options.length = 0;
		}
		for(i=0; i < array.length; i++)
		{
			slt.options[i+j] = new Option(array[i][1],array[i][0]);
		}
	}
	else
	{
		slt.options.length = 0;
		slt.options[0] = new Option('Default',1);
	}
}
function disableScrolling()
{
	document.body.style.overflow = "hidden";
}
function enableScrolling()
{
	document.body.style.overflow = "visible";
}
function object_visibilityByTagNameAndClass(object_tagName,object_className)
{
	var content_array = window.document.getElementsByTagName(object_tagName);
	//alert(content_array.length);
	for(var i=0; i < content_array.length; i++)
	{
		if( content_array[i].className == object_className )
		{
			if( content_array[i].style.visibility != "hidden" )
			{
				
				content_array[i].style.visibility = "hidden";
				//content_array[i].style.display = "none";
			}
			else
			{
				content_array[i].style.visibility = "visible";
				//content_array[i].style.display = "";
			}
		}
	}
}
function popup(popup_containerId,popup_faderId)
{
	var popup_fader = document.getElementById(popup_faderId);
	var popup_container = document.getElementById(popup_containerId);
	if( popup_fader.style.display == "none" )
	{
		popup_fader.style.display = "";
		popup_container.style.display = "";
		
		// disable scrolling
		//disableScrolling();
		object_visibilityByTagNameAndClass("div","flash_content");
		
		popup_container_width = popup_container.clientWidth;
		popup_container_height = popup_container.clientHeight;
		
		popup_container_x = ( getPageWidth() / 2) - (popup_container_width / 2);
		popup_container_y = ( getScrollY() + ( getPageHeight() / 2 ) ) - (popup_container_height / 2);
		
		popup_container.style.left = popup_container_x+"px";
		popup_container.style.top = popup_container_y+"px";
		
		//alert(popup_container_x+"|"+popup_container_y);
		//alert(popup_container.style.left+"|"+popup_container.style.top);
	}
	else
	{
		popup_fader.style.display = "none";
		popup_container.style.display = "none";
		// enable scrolling
		//enableScrolling();
		object_visibilityByTagNameAndClass("div","flash_content");
	}
}
function popup_reload(popup_containerId)
{
	var popup_container = document.getElementById(popup_containerId);
	popup_container_width = popup_container.clientWidth;
	popup_container_height = popup_container.clientHeight;
	
	popup_container_x = ( getPageWidth() / 2) - (popup_container_width / 2);
	popup_container_y = ( getScrollY() + ( getPageHeight() / 2 ) ) - (popup_container_height / 2);
	
	popup_container.style.left = popup_container_x+"px";
	popup_container.style.top = popup_container_y+"px";
}
function xml_get_element(xml_element,xml_element_name)
{
	if(xml_element)
	{
		return xml_element.getElementsByTagName(xml_element_name)[0];
	}
	else
	{
		return null;
	}
}
function xml_get_element_value(xml_element,xml_element_name)
{
	if(xml_element)
	{
		if(xml_element.getElementsByTagName(xml_element_name)[0])
		{
			if(xml_element.getElementsByTagName(xml_element_name)[0].childNodes[0])
			{
				return xml_element.getElementsByTagName(xml_element_name)[0].childNodes[0].nodeValue;
			}
			else
			{
				return null;
			}
		}
		else
		{
			return null;
		}
	}
	else
	{
		return null;
	}
}
function xml_get_element_length(xml_element,xml_element_name)
{
	if(xml_element)
	{
		return xml_element.getElementsByTagName(xml_element_name).length;
	}
	else
	{
		return null;
	}
}
function xml_get_element_array(xml_element,xml_element_name)
{
	if(xml_element)
	{
		return xml_element.getElementsByTagName(xml_element_name);
	}
	else
	{
		return null;
	}
}
