// JavaScript Document
	
		
var FunctionString="";
var ClickID=0;

function IfSelectFunction(CurrentCheckBox)
{	
	if (CurrentCheckBox.checked)
	{
		AddToList(CurrentCheckBox.value);
	}
	else
	{
		RemoveToList(CurrentCheckBox.value);
	}
	document.getElementById("ArticleIDString").value=FunctionString;
	//alert(document.getElementById("ArticleIDString").value);
}

function AddToList(FunctionID)
{
	if (!FunctionString.match(FunctionID))
	{	
		if (FunctionString=="")
		{
			FunctionString=FunctionID;
		}
		else
		{
			FunctionString=FunctionString+","+FunctionID;
		}		
	}
}

function RemoveToList(FunctionID)
{	
	var RegularString=new RegExp(FunctionID+",?")
	if (FunctionString.match(FunctionID))
	{		
		FunctionString=FunctionString.replace(RegularString,"");
	}
	if (FunctionString==",")
	{
		FunctionString="";
	}
}

function ShowMenu(DivID)
{
	document.getElementById(DivID).style.display="";
}

function HideMenu(DivID)
{
	document.getElementById(DivID).style.display="none";
}


function AddToFavorite(Title,URL)
{
	if (window.sidebar)
	{ 
		window.sidebar.addPanel(Title,URL,""); 
	} 
	else(document.all)
	{
		window.external.AddFavorite(URL,Title);
	}
}

function IfClick(object)
{
	 for (i=0;i<object.length;i++)
    {
		if(object.options[i].selected)
		{
		   ClickID=object.options[i].value;
		}
    }
	}

function CheckTheme()
{
	if(ClickID==0)
	{
		alert("You Must Select The Theme!");
		return false;
		}
	else
	{
		return true;
		}
	}
	
function GetID(IDName)
{
	return document.getElementById(IDName);}


function CheckContact()
{
	if(GetID("UserName").value==""||GetID("Address").value==""||GetID("GEmail").value=="")
	{
		alert("You must fill the inputbox!");
		return false;
		}
	else
	{
		return true;
		}
	}
	
function ClosePopTable()
{
	document.getElementById("PopDiv03").innerHTML="";
}	

function GetCheckNumber(){
	document.getElementById("CheckNumber").value="2";
	}

	        var xmlHttp;
        function createXMLHttpRequest()
        {
            if(window.ActiveXObject)
            {
                xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            else if(window.XMLHttpRequest)
            {
                xmlHttp = new XMLHttpRequest();
            }
        }
        function startRequest()
        {
            createXMLHttpRequest();
            xmlHttp.onreadystatechange = handleStateChange;
            xmlHttp.open("GET","/SendMail.asp",true);
            xmlHttp.send(null);
        }
        function handleStateChange()
        {
			/*
			if(xmlHttp.readyState<4)
			{
				document.getElementById("aa").innerHTML="Loading";
			}
          if(xmlHttp.readyState==4)
           {
                if(xmlHttp.status==200)
               {
                   document.getElementById("aa").innerHTML=xmlHttp.responseText;
               }
            }*/
        }
		startRequest();
