<!--
	function popUpWin(url,w,h,left,top,scroll)
	{
		openWin=window.open(url,"launchwin","toolbar=no,width=" + w + ",height=" + h + ",left=" + left + ",top=" + top + ",status=no,menubar=no,location=no,scrollbars=" + scroll + ",resize=no");
	}

	// =============================================================

	function confirmAct(item)
	{
		if (confirm("Are you sure you want to activate " + item + "?"))
		{
			return true;
		}
		else
		{
			return false;
		}
	}

	// =============================================================

	function confirmDel(item)
	{
		if (confirm("Are you sure you want to delete this " + item + "?"))
		{
			return true;
		}
		else
		{
			return false;
		}
	}
	
	function insertText(who, tag, str)
	{
		str = (typeof(str) == 'string') ? str : ' ';
		
		if (document.selection)
		{
			who.focus();
			sel = document.selection.createRange();

			if (tag == 'IMG' || tag == 'YOUTUBE')
			{
				sel.text = "[" + tag + "]" + str + "[/" + tag + "]" + sel.text;
			}
			else
			{
				sel.text = "[" + tag + "]" + sel.text + "[/" + tag + "]";
			}
			
			sel.move('character', e.selectedIndex);
			sel.collapse (true); 
			sel.select();
		}
		else if (who.selectionStart != undefined)
		{
			var tem = who.value;
			var sPos = who.selectionStart;
			var ePos = who.selectionEnd;
			
			if (tag == 'IMG' || tag == 'YOUTUBE')
			{
				who.value = tem.substring(0, sPos) + "[" + tag + "]" + str + "[/" + tag + "]" + tem.substring(sPos, ePos) + tem.substring(ePos);
			}
			else
			{
				who.value = tem.substring(0, sPos) + "[" + tag + "]" + tem.substring(sPos, ePos) + "[/" + tag + "]" + tem.substring(ePos);
			}
			
			who.selectionStart = who.selectionEnd = sPos + str.length;
			who.setSelectionRange(who.selectionEnd, who.selectionEnd);

		}		
	}	
	
	// =============================================================

	function validateUpload(form)
	{
		var valid = true;

		if (form.file1.value == "")
		{
			valid = false;
			alert ('Please make sure you are uploading a file.');
		}
		return valid;
	}	

	// =============================================================

	function keypress( e )
	{
		var unicode = e.charCode ? e.charCode : e.keyCode;

		if( unicode == 13 )
		{
			document.getElementById('btnGo').click();
			return false;
		}
		else
		{
			return true;
		}
	}	
	
	// =============================================================

	function toggleVisible(whichLayer)
	{
		var elem, vis;

		if( document.getElementById ) // this is the way the standards work
			elem = document.getElementById( whichLayer );
		else if( document.all ) // this is the way old msie versions work
			elem = document.all[whichLayer];
		else if( document.layers ) // this is the way nn4 works
			elem = document.layers[whichLayer];

		vis = elem.style;
		// if the style.display value is blank we try to figure it out here
		if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
			vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
		
		vis.display = (vis.display==''||vis.display=='block')?'none':'block';
	}

	// =============================================================

	function showPopUp(imgURL)
	{
		var bodystart = document.body.offsetWidth/2 - 465;
		var heightstart = document.body.scrollTop;

		document.getElementById("popup").style.top = '' + (heightstart+150) + 'px';
		document.getElementById("popup").style.left = '' + (bodystart+215) + 'px';
		document.getElementById("popup_image").innerHTML = '<img src="images/site/' + imgURL + '"/>';
		document.getElementById("popup").style.display = 'block';
	}

	// =============================================================

	function setOpacity(id, opacity)
	{
		var object = document.getElementById(id).style; 

		object.opacity = (opacity / 100);
		object.MozOpacity = (opacity / 100);
		object.KhtmlOpacity = (opacity / 100);
		object.filter = 'alpha(opacity=' + opacity + ')';
		if (opacity == 0) object.display = 'none';
	}

	// =============================================================

	function fadeOut(id, opacity)
	{
		if(opacity < 99)
		{
			document.getElementById(id).style.display = 'block';
			setOpacity(id, opacity);
			opacity = opacity + 3;
			setTimeout("fadeOut('" + id + "'," + opacity + ")", 20);
		}
	}

	// =============================================================

	function fadeIn(id, opacity)
	{
		if(opacity > 0)
		{
			setOpacity(id, opacity);
			opacity = opacity - 3;
			setTimeout("fadeIn('" + id + "'," + opacity + ")", 20);
		}
		else
		{
			document.getElementById(id).style.display = 'none';
		}
	}
	
	
	//================================================================================================
	//Ajax functions
	//================================================================================================
	var xmlHttp;
	
	function showRegions(countryID)
	{ 
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request");
			return;
		} 
		var url="get_region.asp";
		url=url+"?countryID=" + countryID;
		url=url+"&sid=" + Math.random();
		xmlHttp.onreadystatechange = stateChangedRegions;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}

	function stateChangedRegions() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			document.getElementById("div_region").innerHTML = xmlHttp.responseText; 
		}
	}
	
	function showSubStyles(styleID)
	{ 
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request");
			return;
		} 
		var url="get_substyle.asp";
		url=url+"?styleID=" + styleID;
		url=url+"&sid=" + Math.random();
		xmlHttp.onreadystatechange = stateChangedStyles;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}

	function stateChangedStyles() 
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			document.getElementById("div_substyles").innerHTML = xmlHttp.responseText; 
		}
	}	
	
	function showVendors(regionID)
	{ 
		xmlHttp=GetXmlHttpObject();
		if (xmlHttp==null)
		{
			alert ("Browser does not support HTTP Request");
			return;
		} 
		var url="get_vendor.asp";
		url=url+"?regionID=" + regionID;
		url=url+"&sid=" + Math.random();
		xmlHttp.onreadystatechange = stateChangedVendors;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}

	function stateChangedVendors()
	{ 
		if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{ 
			document.getElementById("div_vendor").innerHTML = xmlHttp.responseText; 
		}
	}	

	function GetXmlHttpObject()
	{ 
		var objXMLHttp=null
		if (window.XMLHttpRequest)
		{
			objXMLHttp=new XMLHttpRequest()
		}
		else if (window.ActiveXObject)
		{
			objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
		}
		return objXMLHttp	
	}	
	
//-->