function NewWindow(width,height,url) {
	window.open(url,"PopUp","menubars=0,scrollbars=1,resizable=1,height="+height+",width="+width);
}


function CheckInputData(frm) {
 var skip = false;
 var hobbyselected = false;


  if (!skip && frm.fname.value == "") {
 	alert("First name required");
 	skip = true;
 }

  if (!skip && frm.lname.value == "") {
 	alert("Last name required");
 	skip = true;
 }

 if (!skip && frm.email.value == "") {
 	alert("E-Mail address is required");
 	skip = true;
 }
 
 
 if (!skip && frm.pwd.value =="") {
 	alert("Password is required");
 	skip = true;
 }
  
 if (!skip && frm.pwdr.value =="") {
 	alert("Please confirm password");
 	skip = true;
 }
   
 if (!skip && frm.gender.value == "none") {
 	alert("Please select gender");
 	skip = true;
 }
  
 if (!skip && frm.extra_birthyear.value =="") {
 	alert("Year of birth required");
 	skip = true;
 }



 if (!skip && frm.zipcode.value.length < 5) {
	alert("Zip code is invalid");
	skip = true;
 }
   
 if (!skip && frm.zipcode.value =="00000") {
 	alert("Zip code required");
 	skip = true;
 }
  
  if (!skip && frm.country.selectedIndex < 1) {
 	alert("Country required");
 	skip = true;
 }


 if (!skip && frm.extra_income.selectedIndex < 1) {
 	alert("Household income required");
 	skip = true;
 }

  if (!skip && frm.extra_industry.selectedIndex < 1) {
 	alert("Please select Industry");
 	skip = true;
 }

   if (!skip && frm.extra_job.selectedIndex < 1) {
 	alert("Please select type of employment");
 	skip = true;
 }



 if (!skip && frm.extra_newspaper.selectedIndex < 1) {
 	alert("Please select usage");
 	skip = true;
 }
 if (!skip) {
        InitCookieSearchParams(frm);
 	pbsSetCookie(frm);
 	
 	}
 return (!skip);
}


function choosedate () {
 window.open('/g/kalender_eng.html?searchform.dateselected','','menubar=0,titlebar=0,width=268,height=236');
 document.searchform.Interval.options[document.searchform.Interval.options.length-1].selected = true;
}
function ResetDate () {
 if (document.searchform.Interval.selectedIndex != (document.searchform.Interval.options.length-1))
 {
  document.searchform.dateselected.value = "";
 }
}

function DoPrint () {
 var f = document.searchform;
 f.action = "events?category=print";
 f.submit();
}

function doSubmit(newstart) {
 var frm = document.ccefsearch;
 if (newstart<1) {newstart = 1;}
 frm.start.value = newstart;
 frm.submit();
}

//The functions Get_Cookie,Set_Cookie, Delete_Cookie were obtained from http://tech.irt.org/articles/js064/index.htm and based on the public domain cookie code produced by Bill Dortch
function Get_Cookie(name) {
    var start = document.cookie.indexOf(name+"=");
    var len = start+name.length+1;
    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
    if (start == -1) return null;
    var end = document.cookie.indexOf(";",len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len,end));
}
function Set_Cookie(name,value,expires,path,domain,secure) {
	document.cookie = name + "=" + escape(value) +
        ( (expires) ? ";expires=" + expires.toGMTString() : "") +
        ( (path) ? ";path=" + path : "") + 
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
}
function Delete_Cookie(name,path,domain) {
    if (Get_Cookie(name)) document.cookie = name + "=" +
        ( (path) ? ";path=" + path : "") +
        ( (domain) ? ";domain=" + domain : "") +
        ";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

function EatCookie() {
document.cookie="usernamepassword=;Path=/"
document.cookie="UserRegID=;Path=/"
document.location="/apps/pbcs.dll/frontpage?RegLogout=1&NoCache=1"
}


				function MM_openBrWindow(theURL,winName,features) { //v2.0
				 myFloater = window.open('',winName,features);
				 myFloater.location.href = theURL;
				 myFloater.focus();
				}

				function goForm(type,sym,winName,features) { //v2.0
				if (type == 'forums')
				{
				  myFloater = window.open('http://forums.finwin.com/Forums/qry_stockSearch.cfm?id=997&LUType=symbol&sym=' + sym,winName,features);
				}
				else if (type == 'ResearchReport')
				{
				  //http://www.vereports.com/servlet/main?pid=19&ticker=IBM 
				  myFloater = window.open('http://www.vereports.com/servlet/main?pid=21&ticker=' + sym,winName,features);
				}
				else
				{
				   myFloater = window.open('http://www.finwin.com/finwin/home/quoteprocess.cfm?id=997&nojs=no&colorscheme=2&symbolurl=' + sym + '&type=' + type ,winName,features);
				}
				myFloater.focus();
				}

				function radioVal (ctl) {

					var i;
					var retvar = "quote";
					
					for (i=0; i<ctl.length; i++) 
						if (ctl[i].checked) 
							retvar =  ctl[i].value;

					return retvar;
				}
				
				//METAREFRESH
				
				function reloadTimer(m)
{
//number of seconds desired * 1000 milliseconds == TOTAL SECONDS TO REFRESH
//add an additional * 60 to get minutes.
  setTimeout( "reloading()", m*1000*60);
 }

function reloading()
{
window.location.href = window.location.href;
//window.location.reload() works in all browsers except for ie7
//window.location.reload();
 return false;
}

	


				