function checkQuantity(val,ne)
{
	temp = ""
	for (i=0;i<val.length;i++)
	{
		if (val.substring(i,i+1) >= 0 && val.substring(i,i+1) <= 9)
		{
			temp = temp + val.substring(i,i+1);
		}
	}
	document.getElementById(ne).value = temp;
}

function alertkey(e) {
  if( !e ) {
    //if the browser did not pass the event information to the
    //function, we will have to obtain it from the event register
    if( window.event ) {
		
      //Internet Explorer
      e = window.event;
    } else {
      //total failure, we have no way of referencing the event
      return;
    }
  }
  if( typeof( e.keyCode ) == 'number'  ) {
    //DOM
    e = e.keyCode;
  } else if( typeof( e.which ) == 'number' ) {
    //NS 4 compatible
    e = e.which;
  } else if( typeof( e.charCode ) == 'number'  ) {
    //also NS 6+, Mozilla 0.9+
    e = e.charCode;
  } else {
    //total failure, we have no way of obtaining the key code
    return;
  }
  return FilterChar(e,'num');
  //window.alert('The key pressed has keycode ' + e +
  //  ' and is key ' + String.fromCharCode( e ) );
}

function login()
{
	document.getElementById("topbar").innerHTML= "<div style=height:"+((barheight-561)/2)+"px;></div><iframe scrolling=auto style=background-color:#FFFFFF; frameborder=0 src=registration.asp?rid= width=671 height=568 allowtransparency=true></iframe>";
	document.getElementById("topbar").style.visibility="visible";
}
function checkCountry(cur)
{
	if (cur.value == "Others")
	{
		document.getElementById("Mobile_Country_Code").value = "";
		document.getElementById("Confirm_Mobile_Country_Code").value = "";
		document.getElementById("Country_Code").value = "";
		document.getElementById("Country Code").value = "";
		document.getElementById("Mobile_Country_Code").disabled = false;
		document.getElementById("Confirm_Mobile_Country_Code").disabled = false;
		document.getElementById("Country_Code").disabled = false;
		document.getElementById("Mobile_Country_Code").focus();
	}
	else
	{
		document.getElementById("Mobile_Country_Code").value = countryArray[cur.selectedIndex];
		document.getElementById("Confirm_Mobile_Country_Code").value = countryArray[cur.selectedIndex];
		document.getElementById("Country_Code").value = countryArray[cur.selectedIndex];
		document.getElementById("Country Code").value = countryArray[cur.selectedIndex];
		document.getElementById("Mobile_Country_Code").disabled = true;
		document.getElementById("Confirm_Mobile_Country_Code").disabled = true;
		document.getElementById("Country_Code").disabled = true;
	}
}

function registration(sms)
{
	checkQuantity(document.getElementById("Mobile Number").value,"Mobile Number");
	checkQuantity(document.getElementById("Confirm Mobile Number").value,"Confirm Mobile Number");
	if (document.getElementById("First Name").value.length >= 3)
	{
		if (document.getElementById("Last Name").value.length >= 2)
		{
			if (document.getElementById("Email").value != document.getElementById("Confirm Email").value)
			{ 
				alert("Email must be the same.");
				document.getElementById("Confirm Email").value = "";
				document.getElementById("Confirm Email").focus();
			}
			else
			{
				if (document.getElementById("Preferred Password").value != document.getElementById("Confirm Password").value)
				{ 
					alert("Password must be the same.");
					document.getElementById("Confirm Password").value = "";
					document.getElementById("Confirm Password").focus();
				}
				else
				{
					if (document.getElementById("Mobile Number").value != document.getElementById("Confirm Mobile Number").value)
					{ 
						alert("Mobile Number must be the same.");
						document.getElementById("Confirm Mobile Number").value = "";
						document.getElementById("Confirm Mobile Number").focus();
					}
					else
					{
						if (document.getElementById("Address").value.length <= 4)
						{
							alert("Address must be at least 5 characters.");
							document.getElementById("Address").focus();
						}
						else
						{
							if (document.getElementById("Country Code").value == "")
							{
								alert("Country Code is required.");
								document.getElementById("Mobile_Country_Code").focus();
							}
							else
							{
								if (document.getElementById("Where did you hear about Precise Trader").value == "Others" && document.getElementById("Other").value == "")
								{
									alert("Others Info is required.");
									document.getElementById("Other").focus();
								}
								else
								{
									if (validFrm2("Confirm Submit,First Name,V,Last Name,V,Email,VE,Confirm Email,VE,Preferred Password,VP,Confirm Password,VP,Address,V,Postal Code,V,City,V,Country,V,Mobile Number,V,Alternate Email,E,Where did you hear about Precise Trader,V,Disclaimer,VC"))
									{
										if (sms == "1")
										{
											if (confirm("Please verify and make sure your mobile number and email address are correct." + '\n' + "A SMS with an Activation Pin will be sent to your mobile number (" + document.getElementById("Country_Code").value + " " + document.getElementById("Mobile Number").value + ")." + '\n' + "To edit click Cancel else click Ok."))
											{
												document.form.submit();
											}
											else
											{	
												return false;
											}
										}
										else
										{
											if (confirm("Please verify and make sure your mobile number and email address are correct." + '\n' + "An Email with an Activation Pin will be sent to your email address." + '\n' + "To edit click Cancel else click Ok."))
											{
												document.form.submit();
											}
											else
											{	
												return false;
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
		else
		{
			alert("Last Name must be at least 2 characters.");
			document.getElementById("Last Name").focus();
		}
	}
	else
	{
		alert("First Name must be at least 3 characters.");
		document.getElementById("First Name").focus();
	}
}

//Filter characters on keypress. eg. onKeypress="return FilterChar(event.keyCode,'numbkdash')"
function FilterChar(char,type)
{
	if(char == 8) return true;
	if(type == "nospc" && char == 32) return false;//No space allow.
	if(type == "num") //Numeric only.
	{
		if(char < 48 || char > 57) return false;
	}
	if(type == "numspc") //Numeric only. Space allow.
	{
		if(char < 48 && char != 32 || char > 57) return false;
	}
	if(type == "numdot") //Numeric only. . allow.
	{
		if(char < 48 && char != 46 || char > 57) return false;
	}
	if(type == "numdash") //Numeric only. - allow.
	{
		if(char < 48 && char != 45 || char > 57) return false;
	}
	if(type == "numbkdash") //Numeric only. / allow.
	{
		if(char < 48 && char != 47 || char > 57) return false;
	}
	if(type == "alp") //Alphabet only.
	{
		if(char < 65 || char > 90 && char < 97 || char > 122) return false;
	}
	if(type == "alpspc") //Alphabet only. Space allow.
	{
		if(char < 65 && char != 32 || char > 90 && char < 97 && char != 32 || char > 122) return false;
	}
	if(type == "alpnum_s") //Alphabet(Small Cap only) and numeric only.
	{
		if(char < 48 || char > 57 && char < 97 || char > 122) return false;
	}
	if(type == "alpnum") //Alphabet and numeric only.
	{
		if(char < 48 || char > 57 && char < 65 || char > 90 && char < 97 || char > 122) return false;
	}
	if(type == "email") //Alphabet and numeric only. Allow @.
	{
		if(char < 48 && char != 45 && char != 46 || char > 57 && char < 65 && char != 64 || char > 90 && char < 97 && char != 95 || char > 122) return false;
	}
	return true;
}

function show_pdp()
{
	var browser = navigator.appName;
	for(i=18;i<37;i++)
	{
		if(document.getElementById("pdp_" + i).style.display == "none")
		{
			if(browser == "Netscape")
			{
				document.getElementById("pdp_" + i).style.display = "table-row";
			}
			else
			{
				document.getElementById("pdp_" + i).style.display = "block";
			}
		}
		else
		{
			document.getElementById("pdp_" + i).style.display = "none";
		} 
	}
	if (document.getElementById("previous_read").innerHTML == "expand")
	{
		document.getElementById("previous_read").innerHTML = "close";
	}
	else
	{
		document.getElementById("previous_read").innerHTML = "expand";
	}
}

function changeStatus(id)
{
	if(document.getElementById(id).style.display == "block")
	{
		document.getElementById(id).style.display = "none";
	}
	else
	{
		document.getElementById(id).style.display = "block";
	}
}

var free_webinar = ["wi_ideal","wi_trend"];
function FreeWebinar(id)
{
	if(document.getElementById(id).style.display == "block")
	{
		document.getElementById(id).style.display = "none";
	}
	else
	{
		document.getElementById(id).style.display = "block";
	}
	for(var i=0; i<free_webinar.length; i++)
	{
		
		if(free_webinar[i]!= id)
		{
			document.getElementById(free_webinar[i]).style.display="none"
		}
	}
}

var wi = ["wi_ideal","wi_trend","wi_fibonacci","wi_patterns","wi_osc1","wi_osc2"];
function WI(id)
{
	if(document.getElementById(id).style.display == "block")
	{
		document.getElementById(id).style.display = "none";
	}
	else
	{
		document.getElementById(id).style.display = "block";
	}
	for(var i=0; i<wi.length; i++)
	{
		
		if(wi[i]!= id)
		{
			document.getElementById(wi[i]).style.display="none"
		}
	}
}

var wa = ["wa_technical","wa_trend","wa_chart","wa_fibonacci","wa_andrew","wa_steps","wa_money","wa_live","wa_strategy"];
function WA(id)
{
	if(document.getElementById(id).style.display == "block")
	{
		document.getElementById(id).style.display = "none";
	}
	else
	{
		document.getElementById(id).style.display = "block";
	}
	for(var i=0; i<wa.length; i++)
	{
		
		if(wa[i]!= id)
		{
			document.getElementById(wa[i]).style.display="none"
		}
	}
}

var wx = ["wx_fundamentals","wx_forex","wx_terminology","wx_candlestick","wx_patterns","wx_technical","wx_live","wx_money"];
function WX(id)
{
	if(document.getElementById(id).style.display == "block")
	{
		document.getElementById(id).style.display = "none";
	}
	else
	{
		document.getElementById(id).style.display = "block";
	}
	for(var i=0; i<wx.length; i++)
	{
		
		if(wx[i]!= id)
		{
			document.getElementById(wx[i]).style.display="none"
		}
	}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function changeColor(cur,color){
	cur.style.background = color;
}

// prompt confirm delete message
function confirmDelete(frm) 
{
  var noChecked = 0; // Change to 1 when a checkbox is checked.

  for(var i=0;i < frm.length;i++) 
  {
	if(frm.elements[i].type == "checkbox" && frm.elements[i].checked == true)
	{
	  noChecked = 1;
	}
  }

  if(noChecked == 0) // No record selected. Prompt error message.
  {
	alert("Please select a record to delete!");
	return false;
  }	
  if (confirm("Are you sure you want to delete this record?") == 0) 
  {
      return false;
	  }
  else
  {
      return true;
  }
}

// prompt confirm delete message
function confirmUpdate(frm) 
{
  var noChecked = 0; // Change to 1 when a checkbox is checked.

  for(var i=0;i < frm.length;i++) 
  {
	if(frm.elements[i].type == "checkbox" && frm.elements[i].checked == true)
	{
	  noChecked = 1;
	}
  }

  if(noChecked == 0) // No record selected. Prompt error message.
  {
	alert("Please select a record to update!");
	return false;
  }	
  if (confirm("Are you sure you want to update this record?") == 0) 
  {
      return false;
	  }
  else
  {
      return true;
  }
}

// prompt confirm delete message
function confirmDel(msg)
{
  if (confirm(msg) == 0) 
  {
      return false;
	  }
  else
  {
      return true;
  }
}

ns4=(navigator.appName.indexOf("Netscape")>=0 && !document.getElementById)? 1 : 0;
ie4=(document.all && !document.getElementById)? 1 : 0;
ie5=(document.getElementById && document.all)? 1 : 0;
ns6=(document.getElementById && navigator.appName.indexOf("Netscape")>=0 )? 1: 0;
w3c=(document.getElementById)? 1 : 0;

wid=(ie4||ie5)?window.document.body.clientWidth-20:window.innerWidth-36

if(ns4){document.write ('<layer name="di1"></layer>')}else{document.write ('<div id="di1" style="position:absolute;z-index:100" ></div>')}

outd=""

if(w3c)div1=document.getElementById('di1')
if(ie4)div1=document.all['di1']
if(ns4)div1=document.layers['di1']

function move_div(x,y){
	if (isNaN(x+y))return
	if(ns4){div1.moveTo(x,y)}else{div1.style.left=x+'px';div1.style.top=y+'px';}
}

function write_div(text){
	if(ns4){
		div1.document.open();
		div1.document.write(text);
		div1.document.close();
	}
	else {div1.innerHTML=text;}
}
 
function big(n){
ondiv=n
		write_div("<a href=javascript:void(0) onmouseout='big_hide()' onmouseover='ondiv=1'><table cellspacing=0 cellpadding=0 border=0 bgcolor=#FFFFE8><tr><td height=1 bgcolor=#000000 colspan=5></td></tr><tr><td width=1 bgcolor=#000000></td><td colspan=3 height=2></td><td width=1 bgcolor=#000000></td></tr><tr><td width=1 bgcolor=#000000></td><td width=2></td><td class=content>"+n+"</td><td width=2></td><td width=1 bgcolor=#000000></td></tr><tr><td width=1 bgcolor=#000000></td><td colspan=3 height=2></td><td width=1 bgcolor=#000000></td></tr><tr><td height=1 bgcolor=#000000 colspan=5></td></tr></table></a>");
		move_div(x,y);
}

function big_hide(){
	ondiv=0;
	t3=window.setTimeout('big_hide2()',100)
}

function big_hide2(){
if (ondiv==0){
	write_div("");
	move_div(-1000,-1000)}
}

y=x=0
function dragIt(evt){if(ie4||ie5){x=window.event.clientX+document.body.scrollLeft; y=window.event.clientY+document.body.scrollTop}else {x=evt.pageX ; y=evt.pageY }}

document.onmousemove = dragIt
if(ns4){document.captureEvents( Event.MOUSEMOVE )}

// valid form fieldboxs
function validFrm(str) 
{
  	// General declare for messages.
  	var i,p,nm,counter,condition,errors='',args,title,val;
  	counter = 0;
  	args = str.split(",");
	// loop through all the fields
  	for (i=1; i<(args.length-1); i+=2) 
  	{  
    	if (counter == 0) 
		{
    		condition=args[i+1];
	 		nm=(findObj(args[i])); 
			title=nm.name;
			check=nm.checked;
			val=nm.value;
			// check for empty fields
			if (val !="") 
	    	{
				if (condition.indexOf('P')!=-1) 
            	{
					if (val.length < 4)
					{
						errors=title+' must be at least 4 characters.\n';
						counter = i;
					}
	        	}
				else if (condition.indexOf('C')!=-1) 
            	{
                	if (check == false)
					{
						errors=title+' box is not check.\n';
						counter = i;
					}
	        	}
				// verify number
            	else if (condition.indexOf('N')!=-1) 
            	{
                	if (isNaN(val))
					{
						errors=title+' must be a number.\n';
						counter = i;
					}
	        	}
				// verify email
				else if (condition.indexOf('E')!=-1) 
				{ 
			    	p=val.indexOf('@');
					x=val.indexOf('.');
					myExp = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
				
               		// if (p<1 || p==(val.length-1)) 
			   		if(myExp.test(val) == false)
					{
						errors=title+' must be a valid e-mail address.\n';
						counter = i;
					}
				}
        	}
        	else if (condition.charAt(0) == 'V') 
			{
				errors =title+' is required.\n'; 
				counter = i;
			}
		}
  	} 
	// 	displays error message
  	if (counter != 0) 
  	{
  		alert(errors);
		nm.focus();
		return false;
  	}
  	else
  	{
	  	if (confirm("Confirm " + args[0] + "?") == 0)
	  	{
			if (args[1] == null)
			{
				return false;
			}
			else
			{
		  		(findObj(args[1])).focus();
			}
		  	return false;
	  	}
		else
		{
			return true;
		}
  	}
}

// valid form fieldboxs
function validFrm2(str) 
{
  	// General declare for messages.
  	var i,p,nm,counter,condition,errors='',args,title,val;
  	counter = 0;
  	args = str.split(",");
	// loop through all the fields
  	for (i=1; i<(args.length-1); i+=2) 
  	{  
    	if (counter == 0) 
		{
    		condition=args[i+1];
	 		nm=(findObj(args[i])); 
			title=nm.name;
			check=nm.checked;
			val=nm.value;
			// check for empty fields
			if (val !="") 
	    	{
				if (condition.indexOf('P')!=-1) 
            	{
					if (val.length < 4)
					{
						errors=title+' must be at least 4 characters.\n';
						counter = i;
					}
	        	}
				else if (condition.indexOf('C')!=-1) 
            	{
                	if (check == false)
					{
						errors=title+' box is not check.\n';
						counter = i;
					}
	        	}
				// verify number
            	else if (condition.indexOf('N')!=-1) 
            	{
                	if (isNaN(val))
					{
						errors=title+' must be a number.\n';
						counter = i;
					}
	        	}
				// verify email
				else if (condition.indexOf('E')!=-1) 
				{ 
			    	p=val.indexOf('@');
					x=val.indexOf('.');
					myExp = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;
				
               		// if (p<1 || p==(val.length-1)) 
			   		if(myExp.test(val) == false)
					{
						errors=title+' must be a valid e-mail address.\n';
						counter = i;
					}
				}
        	}
        	else if (condition.charAt(0) == 'V') 
			{
				errors =title+' is required.\n'; 
				counter = i;
			}
		}
  	} 
	// 	displays error message
  	if (counter != 0) 
  	{
  		alert(errors);
		nm.focus();
		return false;
  	}
  	else
  	{
		return true;
  	}
}

function findObj(n, d) 
{
	var p,i,x;  
	if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) 
	{
    	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
  	if(!(x=d[n])&&d.all) x=d.all[n]; 
	for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function getFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}

function checkTrialTotal(total)
{
	temp = 0;
	for(i=0;i<total;i++)
	{
		if(document.getElementById("checkbox"+i).checked)
		{
			temp++;
		}
	}
	if(temp > 1)
	{
		alert("Only 1 category are allow for trial!");
		return false;
	}
	else
	{
		return true;
	}
}

function checkReferral()
{
	for(i=1;i<=10;i++)
	{
		if(document.getElementById("Email Address "+i).value == "" && document.getElementById("Name "+i).value != "")
		{
			alert("Email Address " + i + " is required.\n"); 
			document.getElementById("Email Address "+i).focus();
			return false;
		}
		else if(document.getElementById("Email Address "+i).value != "" && document.getElementById("Name "+i).value == "")
		{
			alert("Name " + i + " is required.\n"); 
			document.getElementById("Name "+i).focus();
			return false;
		}
	}
	return true;
}
function checkReportTotal(total)
{
	temp_sgd_before = 0;
	temp_usd_before = 0;
	temp_sgd = 0;
	temp_usd = 0;
	temp = 0
	temp_string = "";
	for(i=0;i<total;i++)
	{
		if(document.getElementById("checkbox"+i).checked)
		{
			if (i==0)
			{
				temp_string = "1";
			}
			else
			{
				temp_string = temp_string + ",1";
			}
			temp_sgd_before = temp_sgd_before + Number(document.getElementById("price_sgd"+i).value);
			temp_usd_before = temp_usd_before + Number(document.getElementById("price_usd"+i).value);
			if (temp == 0)
			{
				temp_sgd = temp_sgd + Number(document.getElementById("price_sgd"+i).value);
				temp_usd = temp_usd + Number(document.getElementById("price_usd"+i).value);
			}
			else if (temp == 1)
			{
				temp_sgd = temp_sgd + Number(document.getElementById("price_sgd"+i).value) - Number(document.getElementById("more").value);
				temp_usd = temp_usd + Number(document.getElementById("price_usd"+i).value) - Number(document.getElementById("more_usd").value);
			}
			else
			{
				temp_sgd = temp_sgd + Number(document.getElementById("price_sgd"+i).value) - Number(document.getElementById("more2").value);
				temp_usd = temp_usd + Number(document.getElementById("price_usd"+i).value) - Number(document.getElementById("more2_usd").value);
			}
			temp++;
		}
		else
		{
			if (i==0)
			{
				temp_string = "0";
			}
			else
			{
				temp_string = temp_string + ",0";
			}
		}
	}
	
	document.getElementById("temp_string").value = temp_string;
	document.getElementById("bprice_sgd").value = temp_sgd_before;
	document.getElementById("bprice_usd").value = temp_usd_before;
	document.getElementById("price_sgd").value = temp_sgd;
	document.getElementById("price_usd").value = temp_usd;
	//var pro = document.getElementById("Promotion Code").value;
	//alert(temp_sgd);
	//var proArray = new Array();
	//proArray = pro.split(',');
	//promotion = Number(proArray[1]);
	//temp_sgd = temp_sgd * ((100 - promotion)/100);
	//temp_usd = temp_usd * ((100 - promotion)/100);
	
	if (document.getElementById("Month Payment").value == 1 || document.getElementById("Month Payment").value == 0)
	{
		document.getElementById("Price (SGD)").value = r2(temp_sgd);
		document.getElementById("Price (USD)").value = r2(temp_usd);
	}
	else if (document.getElementById("Month Payment").value == 3)
	{
		document.getElementById("Price (SGD)").value = r2(temp_sgd * ((100 - Number(document.getElementById("three months").value))/100))*3;
		document.getElementById("Price (USD)").value = r2(temp_usd * ((100 - Number(document.getElementById("three months").value))/100))*3;
	}
	else if (document.getElementById("Month Payment").value == 6)
	{
		document.getElementById("Price (SGD)").value = r2(temp_sgd * ((100 - Number(document.getElementById("six months").value))/100))*6;
		document.getElementById("Price (USD)").value = r2(temp_usd * ((100 - Number(document.getElementById("six months").value))/100))*6;
	}
}

function r2(n) { 

  ans = n * 1000 
  ans = Math.round(ans /10) + "" 
  
  while (ans.length < 3) {ans = "0" + ans} 
  len = ans.length 
  ans = ans.substring(0,len-2) + "." + ans.substring(len-2,len)
  return ans 
} 

function checkCategory(total)
{
	temp = 0;
	for(i=0;i<total;i++)
	{
		if(document.getElementById("checkbox"+i).checked)
		{
			temp++;
		}
	}
	if(temp == 0)
	{
		alert("Need to select at least one category!");
		return false;
	}
	else
	{
		return true;
	}
}