
var URLArray = new Array();
URLArray[0] = "sendnewsrelease.asp";
//URLArray[1] = "subscribereleaseboth.asp";
URLArray[1] = "subscribenewsdistribution.asp";
URLArray[2] = "newsdistributionlogin.asp";
URLArray[3] = "newsreleasemain.asp";
URLArray[4] = "newsreleaselogin.asp";
URLArray[5] = "showcase.asp";
URLArray[6] = "showcaselogin.asp";
URLArray[7] = "corporatedesign.asp";
URLArray[8] = "corporatedesignlogin.asp";
URLArray[9] = "hedgeevents.asp";
URLArray[10] = "hedgeeventslogin.asp";
URLArray[11] = "searchresults.asp";
URLArray[12] = "advancedsearch.asp";
URLArray[13] = "newsrelease.asp";
URLArray[14] = "hedgeweek.asp";
//URLArray[15] = "subscribereleaseboth.asp";
URLArray[15] = "subscribehedgeweek.asp";
URLArray[16] = "hedgeweeklogin.asp";
URLArray[17] = "hedgeclub.asp";
URLArray[18] = "hedgeclublogin.asp";
URLArray[19] = "hedgereports.asp";
URLArray[20] = "hedgereportslogin.asp";
URLArray[21] = "hedgetrack.asp";
URLArray[22] = "hedgetracklogin.asp";
URLArray[23] = "newsreleasecategory.asp";
URLArray[24] = "archive.asp";
URLArray[25] = "mynewsrelease.asp";
URLArray[26] = "feature.asp";
URLArray[27] = "hedgeweeknewsletter.asp";
URLArray[28] = "newsletterlogin.asp";
URLArray[29] = "updateslogin.asp";
URLArray[30] = "updates.asp";



function CheckLogin(strURL) {
	CheckLogin(strURL,'');
}
function CheckLogin(strURL, strID) {
	if(strURL == "newsdistribution")
	{
		if(isPaid == "HedgeWire") {
			window.location.href = URLArray[0];
		}
		else if (isRegistered){
			window.location.href = URLArray[1];
		}
		else {
			window.location.href = URLArray[2] + "?" + strURL;
		}
	}
	else if(strURL == "newsrelease"){
		if (isRegistered){
			window.location.href = URLArray[3];
		}
		else {
			window.location.href = URLArray[4]  + "?" + strURL;
		}
	}else if(strURL == "showcase"){
		if(isRegistered) {
			window.location.href = URLArray[5];
		}
		else {
			window.location.href = URLArray[6] + "?" + strURL;
		}
	}else if(strURL == "corporatedesign"){
		if(isRegistered) {
			window.location.href = URLArray[7];
		}
		else {
			window.location.href = URLArray[8] + "?" + strURL;
		}
	}else if(strURL == "hedgeevents"){
		if(isRegistered) {
			window.location.href = URLArray[9];
		}
		else {
			window.location.href = URLArray[10] + "?" + strURL ;
		}
	}else if (strURL == "search"){
		if(validateSearchText(document.frmSearch, document.frmSearch.hidCommonWords.value)) {		
			if (isRegistered){				
				document.frmSearch.action = URLArray[11];
				return true;
			}
			else {
				//document.frmSearch.action = URLArray[4] + "?" + strURL + "," + strID;
				document.frmSearch.action = URLArray[11] + "?" + strURL + "," + strID;
				//window.location.href = URLArray[4] + "?" + strURL + "," + strID;				
				return true;
			}
		}
		else
			return false;
	}else if (strURL == "advancesearch"){
		if(isRegistered){
			window.location.href = URLArray[12];
		}
		else {
			window.location.href = URLArray[4] + "?" + strURL;
		}
	}else if (strURL == "news"){
		if(isRegistered)  {
			window.location.href = URLArray[13] + "?" + strID;
		}
		else {
			window.location.href = URLArray[4] + "?" + strURL + "," + strID;
		}
	}else if(strURL == "hedgeweek"){
		if((isPaid == "HedgeWire") || (isPaid == "HedgeWeek")) {
			window.location.href = URLArray[14];
		}
		else if (isRegistered){
			window.location.href = URLArray[15];
		}
		else {
			window.location.href = URLArray[16] + "?" + strURL ;
		}
	}else if(strURL == "hedgeclub"){
		if(isRegistered) {
			window.location.href = URLArray[17];
		}
		else {
			window.location.href = URLArray[18] + "?" + strURL ;
		}
	}else if(strURL == "hedgereports"){
		if(isRegistered) {
			window.location.href = URLArray[19];
		}
		else {
			window.location.href = URLArray[20] + "?" + strURL ;
		}
	}else if(strURL == "hedgetrack"){
		if(isRegistered) {
			window.location.href = URLArray[21];
		}
		else {
			window.location.href = URLArray[22];
		}
	}else if (strURL == "newscategory"){
		if(isRegistered)  {
			window.location.href = URLArray[23] + "?" + strID;
		}
		else {
			window.location.href = URLArray[4];
		}
	}else if (strURL == "archive"){
		if(isRegistered) {
			window.location.href = URLArray[24];
		}
		else {
			window.location.href = URLArray[4];
		}
	}else if(strURL == "mynewsrelease"){
		if(isPaid == "HedgeWire") {
			window.location.href = URLArray[25];
		}
		else if (isRegistered){
			window.location.href = URLArray[1];
		}
		else {
			window.location.href = URLArray[2];
		}
	}
	else if(strURL == "newsletter"){
		if (isRegistered){
			window.location.href = URLArray[27];
		}
		else {
			window.location.href = URLArray[28]  + "?" + strURL + "," + strID;
		}
	}
	else if(strURL == "Feature"){
		if (isRegistered){
			window.location.href = URLArray[26] + "?" + strID;
		}
		else {
			window.location.href = URLArray[4]  + "?" + strURL;
		}
	}
	else if(strURL == "Update"){
		if (isRegistered){
			window.location.href = URLArray[30] + "?" + strID;
		}
		else {
			//window.location.href = URLArray[29];
			winStatus = window.open(URLArray[29]+ "?" + strID,'NewWindow','menubar=no,toolbar=no,location=no,hotkeys=no,status=no,copyhistory=no,width=450,height=350,scrollbars=no,top=175,left=240');
		}
	}	
}

function CheckForm()
{
	document.frmLogin.txtUserName.value = stripBlanks(document.frmLogin.txtUserName.value);
	document.frmLogin.txtPassword.value = stripBlanks(document.frmLogin.txtPassword.value);
	if(document.frmLogin.txtUserName.value == "") {
		alert("Please enter your User Name.");
		document.frmLogin.txtUserName.focus();
		return false;
	}
	if(document.frmLogin.txtPassword.value == "") {
		alert("Please enter your Password.");
		document.frmLogin.txtPassword.focus();
		return false;
	}	
	
	//document.frmLogin.submit()
	return true;

}

function CheckForm()
{
	document.frmLogin.txtUserName.value = stripBlanks(document.frmLogin.txtUserName.value);
	document.frmLogin.txtPassword.value = stripBlanks(document.frmLogin.txtPassword.value);
	if(document.frmLogin.txtUserName.value == "") {
		alert("Please enter your User Name.");
		document.frmLogin.txtUserName.focus();
		return false;
	}
	if(document.frmLogin.txtPassword.value == "") {
		alert("Please enter your Password.");
		document.frmLogin.txtPassword.focus();
		return false;
	}	
	
	//document.frmLogin.submit()
	return true;

}

function CheckLoginForm()
{	
	document.frmCheckLogin.txtUserName.value = stripBlanks(document.frmCheckLogin.txtUserName.value);
	document.frmCheckLogin.txtPassword.value = stripBlanks(document.frmCheckLogin.txtPassword.value);
	if(document.frmCheckLogin.txtUserName.value == "") {
		alert("Please enter your User Name.");
		document.frmCheckLogin.txtUserName.focus();
		return false;
	}
	if(document.frmCheckLogin.txtPassword.value == "") {
		alert("Please enter your Password.");
		document.frmCheckLogin.txtPassword.focus();
		return false;
	}
	return true;
}


function openHelpWindow(strURL)
{
	var FileName = "helptext.htm#" + strURL

	if (screen.width == "800")
	{
		winStatus = window.open(FileName,'NewWindow','menubar=no,toolbar=no,location=no,hotkeys=no,status=yes,copyhistory=no,width=120,height=120,scrollbars=yes,top=0,left=0')
	}
	else
	{
		winStatus = window.open(FileName,'NewWindow','menubar=no,toolbar=no,location=no,hotkeys=no,status=yes,copyhistory=no,width=280,height=250,scrollbars=yes,top=175,left=240')
	}
}
function openWhyRegisterWindow(strURL)
{
	if (screen.width == "800")
	{
		winStatus = window.open(strURL,'NewWindow','menubar=no,toolbar=no,location=no,hotkeys=no,status=no,copyhistory=no,width=460,height=305,scrollbars=no,top=0,left=0')
	}
	else
	{
		winStatus = window.open(strURL,'NewWindow','menubar=no,toolbar=no,location=no,hotkeys=no,status=no,copyhistory=no,width=460,height=305,scrollbars=no,top=175,left=240')
	}
}

function openCheckLogin(strURL,strNewsID)
{
	var FileName = "passwordprotected.asp?Url=" + strURL + "&NewsID=" + strNewsID

	if (screen.width == "800")
	{
		winStatus = window.open(FileName,'NewWindow','menubar=no,toolbar=no,location=no,hotkeys=no,status=no,copyhistory=no,width=450,height=325,scrollbars=no,top=0,left=0')
	}
	else
	{
		winStatus = window.open(FileName,'NewWindow','menubar=no,toolbar=no,location=no,hotkeys=no,status=no,copyhistory=no,width=450,height=325,scrollbars=no,top=175,left=240')
	}
}

/* enable disable starts here */ 
function BrowserCheck()
{
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b

}
function checkEvent(e)
{
	if (e.target !="")
	{
		if (ver.b == 'ns')
		{
			if (e.target.name)
			{
				if (arrElementsStatus[e.target.name] == 'readonly')
				{
					e.target.blur();
					return false;
				}
				else
				{
					return true;
				}
			}
		}
		else
		{
			return true;
		}
	}
}

var netscapeItems;
ver = new BrowserCheck()
var o;
var arrElementsStatus = new Array();
var arrElementsNames = new Array();
var arrListBoxValue = new Array();

if (ver.b == 'ns')
{
	this.document.captureEvents(Event.MOUSEDOWN);
	this.document.captureEvents(Event.FOCUS);
	this.document.onMouseDown=checkEvent;
	this.document.onFocus=checkEvent;
}

function disabletextbox(objName)
{
	if (ver.b == 'ns')
	{
  	  this.arrElementsStatus[objName.name] = 'readonly';
	}
	else
	{
	    objName.disabled = 1;
	}
}

function enabletextbox(objName)
{
	if (ver.b == 'ns')
	{
	    this.arrElementsStatus[objName.name] = 'editable';
	}
	else
	{
	    objName.disabled = 0;
	}
}

/* enable disable ends here */


function closeWind()
{
	window.opener.location.href = "disclaimerregister.htm";
	window.close();
}

function SubmitCategory_Form()
{
	if(frmNewsCategory.category.value == "1")
		document.frmNewsCategory.action = "fundoffunds.htm"
	else if (frmNewsCategory.category.value == "2")
		frmNewsCategory.action = "hedgefunds.htm"
	else if (frmNewsCategory.category.value == "3")
		frmNewsCategory.action = "privateclientassetmanager.htm"
	else if (frmNewsCategory.category.value == "4")
		frmNewsCategory.action = "riskanalysis.htm"
	else if (frmNewsCategory.category.value == "5")
		frmNewsCategory.action = "structuredproducts.htm"
	
	document.frmNewsCategory.submit();
		
}

function SubmitArchiveCategory_Form()
{
	if(frmArchive.category.value == "1")
		document.frmArchive.action = "archive.htm"
	else if (frmArchive.category.value == "2")
		frmArchive.action = "hedgefundsarchive.htm"
	else if (frmArchive.category.value == "3")
		frmArchive.action = "privateclientassetmanagerarchive.htm"
	else if (frmArchive.category.value == "4")
		frmArchive.action = "riskanalysisarchive.htm"
	else if (frmArchive.category.value == "5")
		frmArchive.action = "structuredproductsarchive.htm"
	
	document.frmArchive.submit();
		
}



function contentsInit() 
	{
		document.frames.Contents.document.designMode = "On";	
		
	}
	function format(process) 
	{
	  //if (process == 1)
	  //{
		document.frames.Contents.document.execCommand(process);
		document.frames.Contents.focus();
	  //}		
	}
	function format1(fontname)
	{
		document.frames.Contents.document.execCommand('FontName', false, fontname)
		document.frames.Contents.focus();
	}
		
	function format2(heading)
	{	
		//document.frames.Contents.document.execCommand('FontName', false, "Arial")
		
			if(heading == "1")
			{
				document.frames.Contents.document.execCommand('FontSize', false, "1")
			}
			else if(heading == "2")
			{
				document.frames.Contents.document.execCommand('FontSize', false, "2")
			}
			else if(heading == "3")
			{
				document.frames.Contents.document.execCommand('FontSize', false, "3")
			}
			else if(heading == "4")
			{
				document.frames.Contents.document.execCommand('FontSize', false, "4")
			}
			else if(heading == "5")
			{
				document.frames.Contents.document.execCommand('FontSize', false, "5")
			}
			else if(heading == "6")
			{
				document.frames.Contents.document.execCommand('FontSize', false, "6")
			}
			else if(heading == "7")
			{
				document.frames.Contents.document.execCommand('FontSize', false, "7")
			}
			else
			{
				document.frames.Contents.document.execCommand('FontSize', false, "1")
			}
			document.frames.Contents.focus();
		
		
	}
	function format3(List)
	{
		if(List == "1")
		{
			document.frames.Contents.document.execCommand('InsertOrderedList', false, "List")			
		}
		if(List == "2")
		{
			document.frames.Contents.document.execCommand('InsertUnorderedList', false, "List")
		}
		document.frames.Contents.focus();	
	}
	function format4(link)
	{
		if(link == "Link")
		{
			document.frames.Contents.document.execCommand('CreateLink')
		}
		if(link == "UnLink")
		{
			document.frames.Contents.document.execCommand('UnLink')
		}
		document.frames.Contents.focus();
	}
	function format5(forecolor)
	{
		document.frames.Contents.document.execCommand('ForeColor', false, forecolor)
		document.frames.Contents.focus();
	}
	function format6(edit)
	{
		if(edit == "Cut")
		{
			document.frames.Contents.document.execCommand('Cut', false)
		}
		if(edit == "Copy")
		{
			document.frames.Contents.document.execCommand('Copy', false)
		}
		if(edit == "Paste")
		{
			document.frames.Contents.document.execCommand('Paste', false)
		}
		if(edit == "SelectAll")
		{
			document.frames.Contents.document.execCommand('SelectAll', false)
		}
		document.frames.Contents.focus();
	}
	function format7(justify)
	{
		if(justify == "JustifyLeft")
		{
			document.frames.Contents.document.execCommand('JustifyLeft')
		}
		if(justify == "JustifyCenter")
		{
			document.frames.Contents.document.execCommand('JustifyCenter')
		}
		if(justify == "JustifyRight")
		{
			document.frames.Contents.document.execCommand('JustifyRight')
		}
		document.frames.Contents.focus();
	}
	
	
	function foreColor()
	{
		var arr = showModalDialog("selcolor.htm","","font-family:Arial; font-size:12; dialogWidth:30em; dialogHeight:34em" );
		if (arr != null) 
		document.frames.Contents.document.execCommand('ForeColor',false,arr);	
	}
	
/*  content editor ends here */	
function BrowserCheck()
{
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b

}

function show_calendar(str_target, str_datetime) 
{
	//alert ( str_datetime );
	var arr_months = ["January", "February", "March", "April", "May", "June",
		"July", "August", "September", "October", "November", "December"];
	var week_days = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"];
	var n_weekstart = 1; // day week starts from (normally 0 or 1)	
	var dt_datetime = (str_datetime == null || str_datetime =="" ?  new Date() : str2dt(str_datetime));
	var dt_prev_month = new Date(dt_datetime);
	dt_prev_month.setMonth(dt_datetime.getMonth()-1);
	var dt_next_month = new Date(dt_datetime);
	dt_next_month.setMonth(dt_datetime.getMonth()+1);
	
	var dt_next_year = new Date(dt_datetime);
	dt_next_year.setYear(dt_datetime.getFullYear()+1);	
	
	var dt_prev_year = new Date(dt_datetime);
	dt_prev_year.setYear(dt_datetime.getFullYear()-1);	


	var dt_firstday = new Date(dt_datetime);
	dt_firstday.setDate(1);
	dt_firstday.setDate(1-(7+dt_firstday.getDay()-n_weekstart)%7);
	var dt_lastday = new Date(dt_next_month);
	dt_lastday.setDate(0);
	
	// html generation (feel free to tune it for your particular application)
	// print calendar header
	var intYear = dt_datetime.getFullYear();
	var str_buffer = new String (
		"<html>\n"+
		"<head>\n"+
		"	<title>Calendar</title>\n"+
		"</head>\n"+
		"<body topmargin = '5' bgcolor=\"#ffffff\">\n"+
		"<table class=\"clsOTable\" cellspacing=\"0\" border=\"0\" width=\"100%\">\n"+
		"<tr><td bgcolor=\"#faa61a\">\n"+
		"<table cellspacing=\"1\" cellpadding=\"3\" border=\"0\" width=\"100%\">\n"+
		"<tr>\n	<td bgcolor=\"#faa61a\"><a onfocus = 'this.blur()' href=\"javascript:window.opener.show_calendar('"+
		str_target+"', '"+ dt2dtstr(dt_prev_year)+"');\">"+
		"<img src=\"..\\images\\previousyear.jpg\"  border=\"0\""+
		" alt=\"Previous Year\"></a>" +		
		"<a onfocus = 'this.blur()' href=\"javascript:window.opener.show_calendar('"+
		str_target+"', '"+ dt2dtstr(dt_prev_month)+"');\">"+
		"<img src=\"..\\images\\previousmonth.jpg\"  border=\"0\""+
		" alt=\"Previous Month\"></a></td>\n"+				
		"	<td bgcolor=\"#faa61a\"  align = \"center\">"+
		"<font color=\"white\" face=\"tahoma, verdana\" size=\"2\"><b>"
		+arr_months[dt_datetime.getMonth()]+" " + intYear  + "</b></font></td>\n"+
		"	<td bgcolor=\"#faa61a\" align=\"right\"><a onfocus = 'this.blur()' href=\"javascript:window.opener.show_calendar('"
		+str_target+"', '"+dt2dtstr(dt_next_month)+"');\">"+
		"<img src=\"..\\images\\nextmonth.jpg\"  border=\"0\""+
		" alt=\"Next Month\"></a>" + 
		"<a onfocus = 'this.blur()' href=\"javascript:window.opener.show_calendar('"
		+str_target+"', '"+dt2dtstr(dt_next_year)+"');\">"+
		"<img src=\"..\\images\\nextyear.jpg\"  border=\"0\""+
		" alt=\"Next Year\"></a>" + 
		"</td>\n</tr></table>\n"
	);

	var dt_current_day = new Date(dt_firstday);
	// print weekdays titles
	str_buffer += "<table cellspacing=\"1\" cellpadding=\"3\" border=\"0\" width=\"100%\"><tr>\n";
	for (var n=0; n<7; n++)
		str_buffer += "	<td bgcolor=\"#fecf90\">"+
		"<font color=\"#000000\" face=\"tahoma, verdana\" size=\"2\">"+
		week_days[(n_weekstart+n)%7]+"</font></td>\n";
	// print calendar table
	str_buffer += "</tr>\n";
	var intWeek = 0;
	while (dt_current_day.getMonth() == dt_datetime.getMonth() ||
		dt_current_day.getMonth() == dt_firstday.getMonth()) {
		// print row heder
		str_buffer += "<tr>\n";
		for (var n_current_wday=0; n_current_wday<7; n_current_wday++) {
				if (dt_current_day.getDate() == dt_datetime.getDate() &&
					dt_current_day.getMonth() == dt_datetime.getMonth())
					// print current date
					str_buffer += "	<td bgcolor=\"#fecf90\" align=\"right\">";
				else if (dt_current_day.getDay() == 0 || dt_current_day.getDay() == 6)
					// weekend days
					str_buffer += "	<td bgcolor=\"#efebe2\" align=\"right\">";
				else
					// print working days of current month
					str_buffer += "	<td bgcolor=\"white\" align=\"right\">";

				if (dt_current_day.getMonth() == dt_datetime.getMonth())
					// print days of current month
					str_buffer += "<a href=\"javascript:window.opener.document."+str_target+
					".value='"+dt2dtstr(dt_current_day)+"'; window.close();\">"+
					"<font color=\"#000000\" face=\"tahoma, verdana\" size=\"2\">";
				else 
					// print days of other months
					str_buffer += "<a href=\"javascript:window.opener.document."+str_target+
					".value='"+dt2dtstr(dt_current_day)+"'; window.close();\">"+
					"<font color=\"#B0B8C6\" face=\"tahoma, verdana\" size=\"2\">";
				str_buffer += dt_current_day.getDate()+"</font></a></td>\n";
				dt_current_day.setDate(dt_current_day.getDate()+1);
		}
		// print row footer
		str_buffer += "</tr>\n";
		intWeek ++;
	}
	// print calendar footer
	str_buffer += 
		"</table>\n" +
		"</tr>\n</td>\n</table>\n" +
		"</body>\n" +
		"</html>\n"; 

	
		/* "<form name=\"cal\">\n<tr><td colspan=\"7\" bgcolor=\"#87CEFA\">"+
		"<font color=\"White\" face=\"tahoma, verdana\" size=\"2\">"+
		"Time: <input type=\"text\" name=\"time\" value=\""+dt2tmstr(dt_datetime)+
		"\" size=\"8\" maxlength=\"8\"></font></td></tr>\n</form>\n" +
		"</table>\n" +
		"</tr>\n</td>\n</table>\n" +
		"</body>\n" +
		"</html>\n"; */
	var vWinCal = window.open("", "Calendar", "width=270,height=175,status=no,resizable=no,left=575,top=375" );

	if( intWeek < 5)
		vWinCal.resizeTo(270, intWeek * 59 );	
	else if( intWeek == 5)
		vWinCal.resizeTo(270, intWeek * 53 );
	else
		vWinCal.resizeTo(270, intWeek * 50 );
	vWinCal.opener = self;
	var calc_doc = vWinCal.document;
	calc_doc.write (str_buffer);
	calc_doc.close();
}
// datetime parsing and formatting routimes. modify them if you wish other datetime format
function str2dt (str_datetime) 
{
	var re_date = /^(\d+)\-(\d+)\-(\d+)/;
	if (!re_date.exec(str_datetime))
		return alert("Invalid Datetime format: "+ str_datetime);
	return (new Date (RegExp.$3, RegExp.$2-1, RegExp.$1, RegExp.$4, RegExp.$5, RegExp.$6));
}
function dt2dtstr (dt_datetime) 
{
	var intMonth;
	if((dt_datetime.getMonth()+1) <= 9)
		intMonth = "0" + (dt_datetime.getMonth()+1);
	else
		intMonth = (dt_datetime.getMonth()+1);

	var intDate;
	if( dt_datetime.getDate() <= 9)
		intDate = "0" + dt_datetime.getDate();	
	else
		intDate = dt_datetime.getDate();

	return (new String (intDate+"-"+(intMonth)+"-"+dt_datetime.getFullYear()+" "));
}
function dt2tmstr (dt_datetime) 
{
	return (new String (
			dt_datetime.getHours()+":"+dt_datetime.getMinutes()+":"+dt_datetime.getSeconds()));
}

function openWindowGraph(strURL)
{

	if (screen.width == "800")
	{
		winStatus = window.open(strURL,'NewWindow','menubar=no,toolbar=no,location=no,hotkeys=no,status=yes,copyhistory=no,width=670,height=400,scrollbars=yes,top=0,left=0')
	}
	else
	{
		winStatus = window.open(strURL,'NewWindow','menubar=no,toolbar=no,location=no,hotkeys=no,status=yes,copyhistory=no,width=670,height=560,scrollbars=yes,top=0,left=0')
	}
}


function openWindow(strURL)
{

	if (screen.width == "800")
	{
		winStatus = window.open(strURL,'NewWindow','menubar=no,toolbar=no,location=no,hotkeys=no,status=yes,copyhistory=no,width=790,height=400,scrollbars=yes,top=0,left=0')
	}
	else
	{
		winStatus = window.open(strURL,'NewWindow','menubar=no,toolbar=no,location=no,hotkeys=no,status=yes,copyhistory=no,width=850,height=560,scrollbars=yes,top=0,left=0')
	}
}

function openWindowSendlink(strURL)
{

	if (screen.width == "800")
	{
		winStatus = window.open('sendlink.asp?page=' + strURL ,'NewWindow','menubar=no,toolbar=no,location=no,hotkeys=no,status=yes,copyhistory=no,width=400,height=300,scrollbars=yes,top=0,left=0')
	}
	else
	{
		winStatus = window.open('sendlink.asp?page=' + strURL ,'NewWindow','menubar=no,toolbar=no,location=no,hotkeys=no,status=yes,copyhistory=no,width=400,height=360,scrollbars=yes,top=175,left=240')
	}
}

function btnCancel()
{
	document.location.href="welcome.asp"
}

function NextPage(URL)
{
	document.location.href = URL
}
	

function isempty(strToCheck)
{
	
	var bStringEmpty = true;	
	if( strToCheck != null )
	{
		//getting the length of the string
		var nLength = strToCheck.length	
		//checking the length of the contents of the text box
	
		if(nLength > 0)
		{
			
			for(i=0;i<nLength;i++)
			{
				if (strToCheck.charAt(i) != " " && strToCheck.charAt(i) != "\t" && strToCheck.charCodeAt(i) != 13 && strToCheck.charCodeAt(i) != 10 )
				{
					bStringEmpty = false;
					break;
				}
			}
		}
	}
	return bStringEmpty;
}

var win = null;

function NewWindow(mypage,myname,w,h)
{
	LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable=no'
	win = window.open(mypage,myname,settings)
}

function popupnewwindow(newlink)
{
	if(screen.width==800 && screen.height==600)
		window.open(newlink,null,"height=250,width=600,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,top=100,left=120");
	else
		window.open(newlink,null,"height=250,width=700,status=yes,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes,top=100,left=200");

}

function btnPreLoginCancel()
{
	document.location.href="index.asp"
}

function sponsorRedirect(URL)
{
	popupnewwindow(URL)
}


/**  To check the whether search text is valid */


function validateSearchText(frmSearch,strCommonWords) {
	if(frmSearch.name == "frmSearch")
	{
		frmSearch.txtSearchText.value = stripBlanks(frmSearch.txtSearchText.value);
		if(frmSearch.txtSearchText.value == "")
		{
			alert('Please enter a key word.');
			frmSearch.txtSearchText.focus();
			return false;
		}
	}
	else 
	{
		frmSearch.txtSearchText.value = stripBlanks(frmSearch.txtSearchText.value);
		if(frmSearch.selCategory.value == "-NA-")
		{
			alert('Please select a News Release Category')
			frmAdvanceSearch.selCategory.focus();
			return false;
		}
		if(frmSearch.txtSearchText.value == "")
		{
			alert('Please enter a key word.');
			frmSearch.txtSearchText.focus();
			return false;
		}
	}
	var strSearchText = stripBlanks(frmSearch.txtSearchText.value);
	var strArrayCommonWords = strCommonWords.split(", ")
	for (var wordCount = 0 ; wordCount < strArrayCommonWords.length; wordCount++ ) {
		if (strSearchText == strArrayCommonWords[wordCount]) {
			frmSearch.txtSearchText.focus();
			alert("The key word '" + strSearchText + "' is a common word. This cannot be searched");
			return false;
		}
	}
	return true;
}
/** End of the function */

function stripBlanks(Source)
{
 	var newString;
	var i;
	var j;
	var blank;
	blank = " ";
	newString = "";
	if(Source == null) Source = " ";
	aString = Source;	
	for (i=0; i<aString.length; i++)
	{ 
		if (aString.charAt(i) != blank && aString.charCodeAt(i)!= 13 && aString.charCodeAt(i) != 10 )
		{
			break;
		}
	}
	for (j=aString.length-1; j>=0; j--)
	{
		if (aString.charAt(j) != blank   && aString.charCodeAt(j)!= 13 && aString.charCodeAt(j) != 10 )
		{
				break;
		}
	}
	for(k=i;k<=j;k++)
	{
		newString += aString.charAt(k);
	}	
	return newString;	
}


// ---------------- Country Listing Array -----------------------------------

/*-------------- old county's of UK ----------- new down to this ----------------
var arrUKCounty = new Array();	
	arrUKCounty[0] = "Alderney";
	arrUKCounty[1] = "Avon";
	arrUKCounty[2] = "Bedfordshire";
	arrUKCounty[3] = "Berkshire";
	arrUKCounty[4] = "Borders";
	arrUKCounty[5] = "Buckinghamshire";
	arrUKCounty[6] = "Cambridgeshire";
	arrUKCounty[7] ="Central";
	arrUKCounty[8] = "Cheshire";
	arrUKCounty[9] = "Cleveland";
	arrUKCounty[10] = "Clwyd";
	arrUKCounty[11] = "Cornwal";
	arrUKCounty[12] = "County Antrim";
	arrUKCounty[13] = "County Armagh";
	arrUKCounty[14] = "County Down";
	arrUKCounty[15] = "County Durham";
	arrUKCounty[16] = "County Fermanagh";
	arrUKCounty[17] = "County Londonderry";
	arrUKCounty[18] = "County Tyrone";
	arrUKCounty[19] = "Cumbria";
	arrUKCounty[20] = "Derbyshire";
	arrUKCounty[21] = "Devon";
	arrUKCounty[22] = "Dorse";
	arrUKCounty[23] = "Dumfries & Galloway";
	arrUKCounty[24] = "Dyfed";
	arrUKCounty[25] = "East Sussex";
	arrUKCounty[26] = "Essex";
	arrUKCounty[27] = "Fife";
	arrUKCounty[28] = "Glamorgan";
	arrUKCounty[29] = "Gloucester";
	arrUKCounty[30] = "Grampian";
	arrUKCounty[31] = "Greater London";
	arrUKCounty[32] = "Greater Manchester";
	arrUKCounty[33] = "Guernsey";
	arrUKCounty[34] = "Gwent";
	arrUKCounty[35] = "Gwynedd";
	arrUKCounty[36] = "Hampshire";
	arrUKCounty[37] = "Hereford & Worcester";
	arrUKCounty[38] = "Hertfordshire";
	arrUKCounty[39] = "Highlands";
	arrUKCounty[40] = "Humberside";
	arrUKCounty[41] = "Isle of Man";
	arrUKCounty[42] = "Isle of Wight";
	arrUKCounty[43] = "Jersey";
	arrUKCounty[44] = "Kent";
	arrUKCounty[45] = "Lancashire";
	arrUKCounty[46] = "Leicestershire";
	arrUKCounty[47] = "Lincolnshire";
	arrUKCounty[48] = "Lothian";
	arrUKCounty[49] = "Merseyside";
	arrUKCounty[50] = "Norfolk";
	arrUKCounty[51] = "North Yorkshire";
	arrUKCounty[52] = "Northamptonshire";
	arrUKCounty[53] = "Northumberland";
	arrUKCounty[54] = "Nottinghamshire";
	arrUKCounty[55] = "Orkney";
	arrUKCounty[56] = "Oxfordshire";
	arrUKCounty[57] = "Powys";
	arrUKCounty[58] = "The Sark";
	arrUKCounty[59] = "Shetland";
	arrUKCounty[60] = "Shropshire";
	arrUKCounty[61] = "Somerset";
	arrUKCounty[62] = "South Glamorgan";
	arrUKCounty[63] = "South Yorkshire";
	arrUKCounty[64] = "Staffordshire";
	arrUKCounty[65] = "Strathclyde";
	arrUKCounty[66] = "Suffolk";
	arrUKCounty[67] = "Surrey";
	arrUKCounty[68] = "Tayside";
	arrUKCounty[69] = "Tyne & Wear";
	arrUKCounty[70] = "Warwickshire";
	arrUKCounty[71] = "West Glamorgan";
	arrUKCounty[72] = "West Midlands";
	arrUKCounty[73] = "West Sussex";
	arrUKCounty[74] = "West Yorkshire";
	arrUKCounty[75] = "Western Isles";
	arrUKCounty[76] = "Wiltshire";
-------------------------------------------------------------------*/

var arrUKCounty = new Array();	
		arrUKCounty[0] = "Aberdeenshire";
	arrUKCounty[1] = "Alderney";
	arrUKCounty[2] = "Anglesey/Sir Fon";
	arrUKCounty[3] = "Angus/Forfarshire";
	arrUKCounty[4] = "Argyllshire";
	arrUKCounty[5] = "Avon";
	arrUKCounty[6] = "Ayrshire";
	arrUKCounty[7] = "Bedfordshire";
	arrUKCounty[8] = "Banffshire";
	arrUKCounty[9] = "Berkshire";
	arrUKCounty[10] = "Berwickshire" ;
	arrUKCounty[11] = "Borders";
	arrUKCounty[12] = "Brecknockshire/Sir Frycheiniog";
	arrUKCounty[13] = "Buckinghamshire";
	arrUKCounty[14] = "Buteshire";
	arrUKCounty[15] = "Caernarfonshire/Sir Gaernarfon";
	arrUKCounty[16] = "Caithness";
	arrUKCounty[17] = "Cambridgeshire";
	arrUKCounty[18] = "Cardiganshire/Ceredigion";
	arrUKCounty[19] = "Carmarthenshire/Sir Gaerfyrddin";
	arrUKCounty[20] = "Central";
	arrUKCounty[21] = "Cheshire";
	arrUKCounty[22] = "Clackmannanshire";
	arrUKCounty[23] = "Cleveland";
	arrUKCounty[24] = "Clwyd";
	arrUKCounty[25] = "Cornwal";
	arrUKCounty[26] = "County Antrim";
	arrUKCounty[27] = "County Armagh";
	arrUKCounty[28] = "County Down";
	arrUKCounty[29] = "County Durham";
	arrUKCounty[30] = "County Fermanagh";
	arrUKCounty[31] = "County Londonderry";
	arrUKCounty[32] = "County Tyrone";
	arrUKCounty[33] = "Cromartyshire";
	arrUKCounty[34] = "Cumberland";
	arrUKCounty[35] = "Cumbria";
	arrUKCounty[36] = "Derbyshire";
	arrUKCounty[37] = "Denbighshire/Sir Ddinbych";
	arrUKCounty[38] = "Devon";
	arrUKCounty[39] = "Dorset";
	arrUKCounty[40] = "Dumfries & Galloway";
	arrUKCounty[41] = "Dunbartonshire/Dumbartonshire";
	arrUKCounty[42] = "Dyfed";
	arrUKCounty[43] = "East Lothian/Haddingtonshire";
	arrUKCounty[44] = "East Sussex";
	arrUKCounty[45] = "Essex";
	arrUKCounty[46] = "Fife";
	arrUKCounty[47] = "Flintshire/Sir Fflint";
	arrUKCounty[48] = "Glamorgan/Morgannwg";
	arrUKCounty[49] = "Gloucestershire";
	arrUKCounty[50] = "Grampian";
	arrUKCounty[51] = "Greater London";
	arrUKCounty[52] = "Greater Manchester";
	arrUKCounty[53] = "Guernsey";
	arrUKCounty[54] = "Gwent";
	arrUKCounty[55] = "Gwynedd";
	arrUKCounty[56] = "Hampshire";
	arrUKCounty[57] = "Herefordshire & Worcester";
	arrUKCounty[58] = "Hertfordshire";
	arrUKCounty[59] = "Highlands";
	arrUKCounty[60] = "Huntingdonshire";
	arrUKCounty[61] = "Humberside";
	arrUKCounty[62] = "Inverness-shire";
	arrUKCounty[63] = "Isle of Man";
	arrUKCounty[64] = "Isle of Wight";
	arrUKCounty[65] = "Jersey";
	arrUKCounty[66] = "Kent";
	arrUKCounty[67] = "Kincardineshire";
	arrUKCounty[68] = "Kinross-shire";
	arrUKCounty[69] = "Kirkcudbrightshire";
	arrUKCounty[70] = "Lanarkshire";
	arrUKCounty[71] = "Lancashire";
	arrUKCounty[72] = "Leicestershire";
	arrUKCounty[73] = "Lincolnshire";
	arrUKCounty[74] = "Lothian";
	arrUKCounty[75] = "Nairnshire";
	arrUKCounty[76] = "Merioneth/Meirionnydd";
	arrUKCounty[77] = "Merseyside";
	arrUKCounty[78] = "Middlesex";
	arrUKCounty[79] = "Midlothian/Edinburghshire";
	arrUKCounty[80] = "Monmouthshire/Sir Fynwy";
	arrUKCounty[81] = "Montgomeryshire/Sir Drefaldwyn";
	arrUKCounty[82] = "Morayshire";
	arrUKCounty[83] = "Norfolk";
	arrUKCounty[84] = "North Yorkshire";
	arrUKCounty[85] = "Northamptonshire";
	arrUKCounty[86] = "Northumberland";
	arrUKCounty[87] = "Nottinghamshire";
	arrUKCounty[88] = "Orkney";
	arrUKCounty[89] = "Oxfordshire";
	arrUKCounty[90] = "Peeblesshire";
	arrUKCounty[91] = "Pembrokeshire/Sir Benfro";
	arrUKCounty[92] = "Perthshire";
	arrUKCounty[93] = "Powys";
	arrUKCounty[94] = "Radnorshire/Sir Faesyfed";
	arrUKCounty[95] = "Renfrewshire";
	arrUKCounty[96] = "Ross-shire";
	arrUKCounty[97] = "Roxburghshire";	
	arrUKCounty[98] = "Rutland";
	arrUKCounty[99] = "Selkirkshire";
	arrUKCounty[100] = "Shetland";
	arrUKCounty[101] = "Shropshire";
	arrUKCounty[102] = "Somerset";
	arrUKCounty[103] = "South Glamorgan";
	arrUKCounty[104] = "South Yorkshire";
	arrUKCounty[105] = "Staffordshire";
	arrUKCounty[106] = "Stirlingshire";
	arrUKCounty[107] = "Strathclyde";
	arrUKCounty[108] = "Suffolk";
	arrUKCounty[109] = "Surrey";
	arrUKCounty[110] = "Sussex";
	arrUKCounty[111] = "Sutherland";
	arrUKCounty[112] = "The Sark";
	arrUKCounty[113] = "Tayside";
	arrUKCounty[114] = "Tyne & Wear";
	arrUKCounty[115] = "Warwickshire";
	arrUKCounty[116] = "West Glamorgan";
	arrUKCounty[114] = "West Lothian/Linlithgowshire";
	arrUKCounty[115] = "West Midlands";
	arrUKCounty[116] = "Westmorland";
	arrUKCounty[117] = "West Sussex";
	arrUKCounty[118] = "West Yorkshire";
	arrUKCounty[119] = "Western Isles";
	arrUKCounty[120] = "Wigtownshire";
	arrUKCounty[121] = "Wiltshire";

var arrUSState = new Array();
	arrUSState[0] = "Alabama";
	arrUSState[1] = "Alaska";
	arrUSState[2] = "Arizona";
	arrUSState[3] = "Arkansas";
	arrUSState[4] = "California";
	arrUSState[5] = "Colorado";
	arrUSState[6] = "Connecticut";
	arrUSState[7] = "Delaware";
	arrUSState[8] = "Florida";
	arrUSState[9] = "Georgia";
	arrUSState[10] = "Hawaii";
	arrUSState[11] = "Idaho";
	arrUSState[12] = "Illinois";
	arrUSState[13] = "Indiana";
	arrUSState[14] = "Iowa";
	arrUSState[15] = "Kansas";
	arrUSState[16] = "Kentucky";
	arrUSState[17] = "Louisiana";
	arrUSState[18] = "Maine";
	arrUSState[19] = "Maryland";
	arrUSState[20] = "Massachusetts";
	arrUSState[21] = "Michigan";
	arrUSState[22] = "Minnesota";
	arrUSState[23] = "Mississippi";
	arrUSState[24] = "Missouri";
	arrUSState[25] = "Montana";
	arrUSState[26] = "Nebraska";
	arrUSState[27] = "Nevada";
	arrUSState[28] = "New Hampshire";
	arrUSState[29] = "New Jersey";
	arrUSState[30] = "New Mexico";
	arrUSState[31] = "New York";
	arrUSState[32] = "North Carolina";
	arrUSState[33] = "North Dakota";
	arrUSState[34] = "Ohio";
	arrUSState[35] = "Oklahoma";
	arrUSState[36] = "Oregon";
	arrUSState[37] = "Pennsylvania";
	arrUSState[38] = "Rhode Island";
	arrUSState[39] = "South Carolina";
	arrUSState[40] = "South Dakota";
	arrUSState[41] = "Tennessee";
	arrUSState[42] = "Texas";
	arrUSState[43] = "Utah";
	arrUSState[44] = "Vermont";
	arrUSState[45] = "Virginia";
	arrUSState[46] = "Washington";
	arrUSState[47] = "West Virginia";
	arrUSState[48] = "Wisconsin";
	arrUSState[49] = "Wyoming";
	
//-------------------------------- End of Country Listing Array ----------------------------


function addObjects(source,destination, sourceName)  
{	
	var index;
	var index1;  
	var newoption;
	var isNew;
	var boxLength;
	var selectedItem;
	var selectedText;
	var selectedValue;
	if(source.length  == 0)  
    { 
		alert("There is no " + sourceName + " to be distributed.");
		source.focus();
		return false;
    }  
	if(source.value == '')  
    { 
		alert("Please select the group to be added from the " + sourceName  + " before clicking on the Add button.");
		source.focus();
		return false;
    }  
    else
    { 
		var boxLength = destination.length;		
    }
 	for (index1 = 0; index1 < source.length ; index1++) 
	{
		isNew = true;		 
		if (source.options[index1].selected)
	 	{
	 		selectedItem = source.options[index1];		
			selectedText = source.options[index1].text;		
			selectedValue = source.options[index1].value;		
			if (boxLength != 0)
			{
				for (index = 0; index < boxLength; index++) 
				{  
					thisitem = destination[index].value;					
					if (thisitem == selectedValue) 
					{						
						isNew = false;						
						break;
					}     
				}
			}	
			if (isNew) 
			{
			    newoption = new Option(selectedText, selectedValue, false,false);
			    destination.options[boxLength] = newoption;			  
			} 			
			boxLength = destination.length;
		}
	}
	source.value = "";
	source.selectedIndex = -1;
}
function removeObjects(source, sourceName) 
{
	var x;
    var boxLength = source.length;
    if (boxLength == 0)
		{
			alert("There is no " + sourceName +  " to be removed.");
			source.focus();
			return;
		}    
	arrSelected = new Array();
	var count = 0;
		for (i = 0; i < boxLength; i++) 
		{
			if (source.options[i].selected) 
			{
				arrSelected[count] = source.options[i].value;
			}
			count++;			
		}		
		if (source.value =="")
			{
				alert("Please select the " + sourceName +  " to be removed before clicking on the Remove button.");
				source.focus();
				return;
			}					
		for (i = 0; i < boxLength; i++) 
		{
			for (x = 0; x < arrSelected.length; x++) 
			{
				if (source.options[i].value == arrSelected[x]) 
				{
					source.options[i] = null;
				}	
			}
				boxLength = source.length;
		}       
}


/* Current date script */

var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()+1
if (month<10)
month="0"+month
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym



/* End Of Current date Script */


function ValidateMaxLength(source,intLength,strSourceName)
{
	if (source.value.length > intLength)
	{
	
		alert("Please enter only " + intLength + " characters in " + strSourceName + "." );
		source.focus();	
		source.select();
		return false;
	}
	else
	{
		return true;
	}	
}


function ConvertProperCase(Field)
{
	var tmpStr;
	tmpStr=Field.value;
	tmpStr = stripBlanks(Field.value);
	Field.value=tmpStr;
	tmpStr = tmpStr.substr(0,1).toUpperCase() + tmpStr.substr(1,tmpStr.length);
	Field.value=tmpStr;
}

function ConvertName(Field)
{
	
 /*var index;
 var tmpStr;
 var tmpChar;
 var preString;
 var postString;
 var strlen;

 tmpStr = Field.value.toLowerCase();
 strLen = tmpStr.length;
	if (strLen > 0)  
	{
		for (index = 0; index < strLen; index++)  
		{
			if (index == 0)  
			{
				tmpChar = tmpStr.substring(0,1).toUpperCase();
				postString = tmpStr.substring(1,strLen);
				tmpStr = tmpChar + postString;
			}
			else 
			{
				tmpChar = tmpStr.substring(index, index+1);
				if (tmpChar == " " && index < (strLen-1))  
				{
					tmpChar = tmpStr.substring(index+1, index+2).toUpperCase();
					preString = tmpStr.substring(0, index+1);
					postString = tmpStr.substring(index+2,strLen);
					tmpStr = preString + tmpChar + postString;
         			}
      			}
   		}
	}
	Field.value = tmpStr;
*/

	var tmpStr;

	tmpStr=Field.value;
	tmpStr = stripBlanks(Field.value);
	Field.value=tmpStr;
	
	tmpStr = tmpStr.substr(0,1).toUpperCase() + tmpStr.substr(1,tmpStr.length).toLowerCase();
	Field.value=tmpStr;


	
}

//------------- Function for Email check Starts -----------------

function emailCheck(email)
{
	var intI=1;
	var intCounter=0;
	strEmail=email.value;
	var strEmailLength = strEmail.length;
	var check =1;
	 if (email.value == '')	
	 {
	 	alert('Please enter an E-mail ID.');
	 	email.focus();
	 	check = 0; 
	 	return check;
	 }
	 // look for @
	 while ((intI < strEmailLength) && (strEmail.charAt(intI) != "@"))
	 { intI++ }
	 if ((intI >= strEmailLength) || (strEmail.charAt(intI) != "@"))
	 {
	 	//alert('E-mail ID should be of the form - name@company.com or name@company.co.country. Please try again.');
	 //	email.focus();
	 	check = 0; 
	 	return check;
	 }
	 else intI += 2;
    // look for .
    while ((intI < strEmailLength) && (strEmail.charAt(intI) != "."))
	{ intI++     }
	// there must be at least one character after the .
    diff=strEmailLength - intI;
	if ((intI >= strEmailLength - 1) || (strEmail.charAt(intI) != ".")) 
	{
	   // alert('E-mail ID should be of the form - name@company.com or name@company.co.country. Please try again.');
    	//email.focus();
	    check = 0; 
		return check;
	}
	var valid1='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@._0123456789-';
    var temp1;
	var fieldx=email.value;
	for (var intI=0; intI <fieldx.length; intI++) 
	{
		temp1 = "" + fieldx.substring(intI, intI+1);
	    if(temp1 == "@")
		{
			intCounter=intCounter+1;
		}
		if (valid1.indexOf(temp1) == "-1")
		{
		//	alert("E-mail ID should be of the form - name@company.com or name@company.co.country. Please try again.");
		//	email.focus();
			check = 0; 
	 		return check;
		}
	}
	var strSourceField = email.value;
	var blnNumCheckStatus = true;
	var intDectot  = 0;
	var intDecpos  = 0;
	var strValidchars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@._0123456789-";
	for(var intDecCount=0; intDecCount<strSourceField.length;intDecCount++) 
	{
		if(strSourceField.charAt(intDecCount)=='@') 
		{
			intDectot++;
			intDecpos = (intDecCount+1);
		}
		if (intDectot>1)
		{
			blnNumCheckStatus = false;
		}
	}
	if(blnNumCheckStatus==false)
	{
		//alert("E-mail ID should be of the form - name@company.com or name@company.co.country. Please try again.");
		//email.focus();
		return blnNumCheckStatus;
	}
	if ((email.value.length < 6) || (email.value.length > 80))
	{
		//alert("E-mail ID should be of the form - name@company.com or name@company.co.country. Please try again.");
		//email.focus();
		check = 0; 
	 //	return check;
	}
	var invalid = " "; // Invalid character is a space
	if (email.value.indexOf(invalid) > -1) 
	{
	//	alert("E-mail ID should be of the form - name@company.com or name@company.co.country. Please try again.");
	//	email.focus();
		check = 0; 
		return check;
	}
	var strSourceField = email.value;
	var blnNumCheckStatus = true;
	var intDectot  = 0;
	var intDecpos  = 0;
	var strValidchars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@._0123456789-";
	for(var intDecCount=0; intDecCount<strSourceField.length;intDecCount++) 
	{
		if(strSourceField.charAt(intDecCount)=='@') 
		{
			intDectot++;
			intDecpos = (intDecCount+1);
		}
		if (intDectot>1)
		{
			blnNumCheckStatus = false;
		}
	}
	if(blnNumCheckStatus==false)
	{
		//alert("E-mail ID should be of the form - name@company.com or name@company.co.country. Please try again. ");
		//email.focus();
		return blnNumCheckStatus;
	}
	
	return check;
}

//------------- Function for Email check Ends -------------------

function UserNameCheck(Field)
{
	var strTmp = Field.value;  	
	
	var valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890_@." ;
	var temp;
	for (var i=0; i<strTmp.length; i++)
	{
		temp = ""+ strTmp.substring(i, i+1);
				
		if (valid.indexOf(temp) == -1) 
		{
			return false;
			break;
		}
	}
	return true;   	
}


function NameCheck(Field)
{
	var strTmp = Field.value;  	
	
	var valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz " ;
	var temp;
	for (var i=0; i<strTmp.length; i++)
	{
		temp = ""+ strTmp.substring(i, i+1);
				
		if (valid.indexOf(temp) == -1) 
		{
			return false;
			break;
		}
	}
	return true;   	
}


function ZipCodeCheck(Field)
{
	var strTmp = Field.value;
	var intBlankOccurance = 0;
	var strAlertMsg;
	var valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890 " ;
	var temp;

	for (var i=0; i<strTmp.length; i++)
	{
		temp = ""+ strTmp.substring(i, i+1);

		if (valid.indexOf(temp) == -1)
		{
			return false;
			break;
		}
		else
		{
			if(temp == " ")
			{
				intBlankOccurance = intBlankOccurance + 1;
			}
		}
	}
	if (intBlankOccurance > 1)
		return false;
	else
		return true;
}


function PhoneNumberCheck(Field)
{
	var strTmp = Field.value;
	var intBlankOccurance = 0;
	var intHypenOccurance = 0;
	var strAlertMsg;
	var valid = "1234567890 -()" ;
	var temp;

	for (var i=0; i<strTmp.length; i++)
	{
		temp = ""+ strTmp.substring(i, i+1);

		if (valid.indexOf(temp) == -1)
		{
			return false;
			break;
		}		
	}
		return true;
}
//-------------------------------- End of Country Listing Array --------------



function datecompare(getfrmDate,gettoDate)
{
	var frmDate, toDate;
	var intFromMonth = getfrmDate.substr(3,2)
	
	var intToMonth = gettoDate.substr(3,2)
	if( intFromMonth <= "09" )
	{
		intFromMonth = intFromMonth.substr(1,1)
		intTestMonth = parseInt(intFromMonth)
		intFromMonth = intTestMonth - 1
	}
	else
		intFromMonth = parseInt(intFromMonth) - 1

	if( intToMonth <= "09" )
		intToMonth = parseInt(intToMonth.substr(1,1)) - 1
	else
		intToMonth = parseInt(intToMonth) - 1

	var frmDate = new Date( getfrmDate.substr(6,4), intFromMonth , getfrmDate.substr(0,2) );
	var toDate  = new Date( gettoDate.substr(6,4), intToMonth , gettoDate.substr(0,2) );
	

	if(toDate <= frmDate)
		return false;
	else
		return true;

}

function comparetodaydate(getdate)
{
	var strToMonth = getdate.substr(3,2);
	var intToMonth;
	
	if( strToMonth <= "09" )
	{
		 strToMonth = strToMonth.substr(1,1)
		 tToMonth = parseInt(strToMonth)	
		 intToMonth = parseInt(tToMonth) - 1
	}
	else
		 intToMonth = parseInt(strToMonth) - 1
		
	var toDate  = new Date( getdate.substr(6,4), intToMonth , getdate.substr(0,2) );


	var strCurrentdate = new Date();
	
	if ( toDate > strCurrentdate) 
		return true
	else
		return false;

}

//--------------------------------Flash Scripts Starat Here

function goToPlay()
{
	
	if(document.frmFlash!=null)
	{
		document.frmFlash.hopeMenus.tgotoframe("/", 10);
	}
}
function goToStop()
{

	if(document.frmFlash!=null)
	{
		document.frmFlash.hopeMenus.tgotoframe("/",0);
	}	
	
}
//--------------------------------Flash Scripts End Here