function SymError()
{
  return true;
}
window.onerror = SymError;
// Rev. 19/12/2005
function popupwin(url,w,h) { 
     var winl = (screen.width - w) / 2;
     var wint = (screen.height - h) / 2;
     winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+'resizable=0'
  	 win=window.open(url,'name', winprops);
	 win.focus();
  }
// Rev. 09/07/2005
function closeMenus(url) {
	Toggle('adminindex',url);
	Toggle('serversettings',url);
	Toggle('category',url);
}
function Toggle(item,url) {
	var obj;
	if ( document.getElementById ) 
   	{
		obj=document.getElementById(item);
	} else {
		obj = document.all[item];
	}
	var key;
   	if ( document.getElementById ) 
   	{
		key=document.getElementById("x" + item);
	} else {
		key = document.all['x' +item];
	}	

	if (obj != undefined) {
		var visible = ( obj.style.display != 'none');
		if (visible) {
			obj.style.display="none";
			key.innerHTML="<img src='"+url+"plus_new.gif' width='11' height='11' hspace='0' vspace='0' border='0'>";
		} else {
			obj.style.display="block";
			key.innerHTML="<img src='"+url+"neg_new.gif' width='11' height='11' hspace='0' vspace='0' border='0'>";
		}
	}
}

function Expand(url) {
   if (document.getElementById) {
	    divs=document.getElementsByTagName("DIV");
	} else {		
		divs = document.all['DIV'];
	}

   for (i=0;i<divs.length;i++) {
     divs[i].style.display="block";
     key=document.getElementById("x" + divs[i].id);
     key.innerHTML="<img src='"+url+"neg_new.gif' width='11' height='11' hspace='0' vspace='0' border='0'>";
   }
}

function Collapse(url) {
	if (document.getElementById) {
	    divs=document.getElementsByTagName("DIV");
	} else {		
		divs = document.all['DIV'];
	}
   
   for (i=0;i<divs.length;i++) {
     divs[i].style.display="none";
     key=document.getElementById("x" + divs[i].id);
     key.innerHTML="<img src='"+url+"plus_new.gif' width='11' height='11' hspace='0' vspace='0' border='0'>";
   }
}
function cc(){
if (document.frm_upload.genres.value=="0")
{
	alert("You must select a genres name. Please select genres name.");
	document.frm_upload.genres.value="";
}
}
function changeHTML() 
{
//alert("**********") ;
var optionValue = document.frm_newreg.country.value; 
//alert(optionValue);


if(optionValue=="UNITED STATES")
{ 
changeStuff.innerHTML = "<select name=state class=dropdown>"+
"<option value=0>Please Select your state</option>"+
"<option value=AL>Alabama</option>"+
"<option value=AK>Alaska</option>"+
"<option value=AZ>Arizona</option>"+
"<option value=AR>Arkansas</option>"+
"<option value=CA>California</option>"+
"<option value=CO>Colorado</option>"+
"<option value=CT>Connecticut</option>"+
"<option value=DC>District of Columbia</option>"+
"<option value=DE>Delaware</option>"+
"<option value=FL>Florida</option>"+
"<option value=GA>Georgia</option>"+
"<option value=HI>Hawaii</option>"+
"<option value=ID>Idaho</option>"+
"<option value=IL>Illinois</option>"+
"<option value=IN>Indiana</option>"+
"<option value=IA>Iowa</option>"+
"<option value=KS>Kansas</option>"+
"<option value=KY>Kentucky</option>"+
"<option value=LA>Louisiana</option>"+
"<option value=ME>Maine</option>"+
"<option value=MD>Maryland</option>"+
"<option value=MA>Massachusetts</option>"+
"<option value=MI>Michigan</option>"+
"<option value=MN>Minnesota</option>"+
"<option value=MS>Mississippi</option>"+
"<option value=MO>Missouri</option>"+
"<option value=MT>Montana</option>"+
"<option value=NE>Nebraska</option>"+
"<option value=NV>Nevada</option>"+
"<option value=NH>New Hampshire</option>"+
"<option value=NJ>New Jersey</option>"+
"<option value=NM>New Mexico</option>"+
"<option value=NY>New York</option>"+
"<option value=NC>North Carolina</option>"+
"<option value=ND>North Dakota</option>"+
"<option value=OH>Ohio</option>"+
"<option value=OK>Oklahoma</option>"+
"<option value=OR>Oregon</option>"+
"<option value=PA>Pennsylvania</option>"+
"<option value=RI>Rhode Island</option>"+
"<option value=SC>South Carolina</option>"+
"<option value=SD>South Dakota</option>"+
"<option value=TN>Tennessee</option>"+
"<option value=TX>Texas</option>"+
"<option value=UT>Utah</option>"+
"<option value=VT>Vermont</option>"+
"<option value=VA>Virginia</option>"+
"<option value=WA>Washington</option>"+
"<option value=WV>West Virginia</option>"+
"<option value=WI>Wisconsin</option>"+
"<option value=WY>Wyoming</option></select>"; 
} 
else if(optionValue=="CANADA")
{

changeStuff.innerHTML = "<select name=state class=dropdown>"+
"<option value=0>Please Select your state</option>"+
"<option value=Alberta>Alberta</option>"+
"<option value=British Columbia>British Columbia</option>"+
"<option value=Manitoba>Manitoba</option>"+
"<option value=New Brunswick>New Brunswick</option>"+
"<option value=Newfoundland>Newfoundland</option>"+
"<option value=Northwest Territories>Northwest Territories</option>"+
"<option value=Nova Scotia>Nova Scotia</option>"+
"<option value=Ontario>Ontario</option>"+
"<option value=Prince Edward Island>Prince Edward Island</option>"+
"<option value=Québec>Québec</option>"+
"<option value=Saskatchewan>Saskatchewan</option>"+
"<option value=Yukon Territory>Yukon Territory</option>"+
"</select>" ;
} else
{ 
changeStuff.innerHTML = "<input type=text name=state class='forminputelement'>"; 
} 
}
var checkobj

function agreesubmit(el){
checkobj=el
if (document.all||document.getElementById){
for (i=0;i<checkobj.form.length;i++){  //hunt down submit button
var tempobj=checkobj.form.elements[i]
if(tempobj.type.toLowerCase()=="submit")
tempobj.disabled=!checkobj.checked
}
}
}

// Rev. 10/04/2006
function HD(){
data = document.frm_newreg.HowDid.value;
if(data=='Other' || data=='Other website'){
NO.innerHtml=data;
document.frm_newreg.newOther.style.display='inline';
}else{
NO.innerHtml=data;
document.frm_newreg.newOther.style.display='none';
}
}

function defaultagree(el){
if (!document.all&&!document.getElementById){
if (window.checkobj&&checkobj.checked)
return true
else{
alert("Please read/accept terms to submit form")
return false
}
}
}
function check_newuser()
{
 defaultagree(document.frm_newreg.agreecheck.value)
if(document.frm_newreg.user_name.value.length == 0)
				{
				alert("Please enter your user name.");
				document.frm_newreg.user_name.focus();
				return false;
				}
if(document.frm_newreg.user_name.value.length <= 3)
				{
				alert("Your user name must be more than 3 characters length.");
				document.frm_newreg.user_name.focus();
				return false;
				}
if(document.frm_newreg.password1.value == 0)
				{
				alert("Please enter your password.");
				document.frm_newreg.password1.focus();
				return false;
				}
if(document.frm_newreg.password1.value.length < 6)
				{
				alert("Password must be more than 6 characters length.");
				document.frm_newreg.password1.focus();
				return false;
				}
if(document.frm_newreg.password2.value.length == 0)
				{
				alert("Please re-type your password.");
				document.frm_newreg.password2.focus();
				return false;
				}
			
if(document.frm_newreg.password1.value!=document.frm_newreg.password2.value)
				{
				alert("The password and confirm password are not matching.");
				document.frm_newreg.password2.focus();
				return false;
				}
if(document.frm_newreg.first_name.value.length == 0)
		{
				alert("Please enter your first name.");
				document.frm_newreg.first_name.focus();
				return false;
				}
if(document.frm_newreg.last_name.value.length == 0)
		{
				alert("Please enter your last name.");
				document.frm_newreg.last_name.focus();
				return false;
				}
if(document.frm_newreg.email.value.length<=0)
				{
				alert("Please enter your E-mail address.");
				document.frm_newreg.email.focus();
				return false;
				}
var remail=/^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$/;
			if(!remail.test(document.frm_newreg.email.value))
				{
				alert("Please enter your correct E-mail address.");
				document.frm_newreg.email.focus();
				document.frm_newreg.email.select(true);
				return false;
				}
/*
if(document.frm_newreg.paypal.value.length<=0)
				{
				alert("Please enter your Paypal address.");
				document.frm_newreg.paypal.focus();
				return false;
				}
var remail=/^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$/;
			if(!remail.test(document.frm_newreg.paypal.value))
				{
				alert("Please enter your correct Paypal address.");
				document.frm_newreg.paypal.focus();
				document.frm_newreg.paypal.select(true);
				return false;
				}
*/
if(document.frm_newreg.address.value.length == 0)
				{
				alert("Please enter your address.");
				document.frm_newreg.address.focus();
				return false;
				}
if(document.frm_newreg.state.value == '')
				{
				alert("Please choose a state.");
				document.frm_newreg.state.focus();
				return false;
				}
if(document.frm_newreg.zip.value.length == 0)
				{
				alert("Please enter your Zip code.");
				document.frm_newreg.zip.focus();
				return false;
				}
}

function check_user()
{
if(document.frm_ep.first_name.value.length == 0)
				{
				alert("Please enter your first name.");
				document.frm_ep.first_name.focus();
				return false;
				}
if(document.frm_ep.last_name.value.length == 0)
				{
				alert("Please enter your last name.");
				document.frm_ep.last_name.focus();
				return false;
				}
/*
if(document.frm_ep.paypal.value.length<=0)
				{
				alert("Please enter your Paypal address.");
				document.frm_ep.paypal.focus();
				return false;
				}
var remail=/^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$/;
			if(!remail.test(document.frm_ep.paypal.value))
				{
				alert("Please enter your correct Paypal address.");
				document.frm_ep.paypal.focus();
				document.frm_ep.paypal.select(true);
				return false;
				}
*/
if(document.frm_ep.email.value.length<=0)
				{
				alert("Please enter your E-mail address.");
				document.frm_ep.email.focus();
				return false;
				}
var remail=/^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$/;
			if(!remail.test(document.frm_ep.email.value))
				{
				alert("Please enter your correct E-mail address.");
				document.frm_ep.email.focus();
				document.frm_ep.email.select(true);
				return false;
				}
if(document.frm_ep.address.value.length == 0)
				{
				alert("Please enter your address.");
				document.frm_ep.address.focus();
				return false;
				}
if(document.frm_ep.state.value == '')
				{
				alert("Please choose a state.");
				document.frm_ep.state.focus();
				return false;
				}
if(document.frm_ep.zip.value.length == 0)
				{
				alert("Please enter your Zip code.");
				document.frm_ep.zip.focus();
				return false;
				}
}



function check_upload()
{
if(document.frm_upload.file_img.value.length != 0)
	{  
		var ext = document.frm_upload.file_img.value;
  		ext = ext.substring(ext.length-3,ext.length);
  		ext = ext.toLowerCase();
  		if(ext != 'jpg' && ext != 'gif') {
    		alert('There is a problem with your thumbnail image. You selected a .'+ext+
          	' file; please select a .jpg or .gif file instead!');
          	document.getElementById('indicator_image_1').style.display='none';
    		return false; 	
		}
	}
if(document.frm_upload.media_name.value.length == 0)
	{		
		alert("Please enter your media name.");		
		document.frm_upload.media_name.focus();
		document.getElementById('indicator_image_1').style.display='none';
		return false;
	}
if (document.frm_upload.genres_id.value=="")
	{
		alert("Please select a genres name.");
		document.frm_upload.genres_id.focus();
		document.getElementById('indicator_image_1').style.display='none';
		return false;
	}
if(document.frm_upload.media_type.value == "")
	{
		alert("Please choose a media type.");
		document.frm_upload.media_type.focus();
		document.getElementById('indicator_image_1').style.display='none';
		return false;
	}
if(document.frm_upload.media_desc.value.length == 0)
	{
		alert("Please give a short description of your media.");
		document.frm_upload.media_desc.focus();
		document.getElementById('indicator_image_1').style.display='none';
		return false;
	}
if(document.frm_upload.media_copyright.value.length == 0)
	{
		alert("Please give copyright description of your media.");
		document.frm_upload.media_copyright.focus();
		document.getElementById('indicator_image_1').style.display='none';
		return false;
	}
if(document.frm_upload.media_director.value.length == 0)
	{
		alert("Please enter director name.");
		document.frm_upload.media_director.focus();
		document.getElementById('indicator_image_1').style.display='none';
		return false;
	}
new_time = document.frm_upload.media_h.value + document.frm_upload.media_m.value + document.frm_upload.media_s.value
if(new_time == 0)
	{
		alert("Please enter appropriate media time.");
		document.frm_upload.media_s.focus();
		document.getElementById('indicator_image_1').style.display='none';
		return false;
	}
if(document.frm_upload.media_price.value <= 0.98)
	{
		alert("Price of your media must be at least $0.99.");
		document.frm_upload.media_price.focus();
		document.getElementById('indicator_image_1').style.display='none';
		return false;
	}
	/*
if(document.frm_upload.media_producer.value.length == 0)
	{
		alert("Please enter producer name.");
		document.frm_upload.media_producer.focus();
		return false;
	}
if(document.frm_upload.media_writer.value.length == 0)
	{
		alert("Please enter writer name.");
		document.frm_upload.media_writer.focus();
		return false;
	}
if(document.frm_upload.media_actors.value.length == 0)
	{
		alert("Please enter actors name.");
		document.frm_upload.media_actors.focus();
		return false;
	}
if(document.frm_upload.media_awards.value.length == 0)
	{
		alert("Please enter awards name.");
		document.frm_upload.media_awards.focus();
		return false;
	}
if(document.frm_upload.media_reviews.value.length == 0)
	{
		alert("Please enter reviews name.");
		document.frm_upload.media_reviews.focus();
		return false;
	}
	*/
/*if(document.frm_upload.media_price.value == 0)
	{
		alert("Please enter price of your media.");
		document.frm_upload.media_price.focus();
		return false;
	}
if(document.frm_upload.film_festivals.value.length == 0)
	{
		alert("Please enter film festival events of your media.");
		document.frm_upload.film_festivals.focus();
		return false;
	}
	*/
if(document.frm_upload.media_format.value == "")
	{
	alert("Please choose a media format.");
	document.frm_upload.media_format.focus();
	document.getElementById('indicator_image_1').style.display='none';
	return false;
    }
if(document.frm_upload.msize.value == "")
	{
	alert("Please choose media size.");
	document.frm_upload.msize.focus();
	document.getElementById('indicator_image_1').style.display='none';
	return false;
    }
if(document.frm_upload.payment.value == "")
	{
	alert("Please choose a payment method.");
	document.frm_upload.payment.focus();
	document.getElementById('indicator_image_1').style.display='none';
	return false;
    }
}
function comment(){
if (document.frm_comm.comm_desc.value=="")
{
	alert("Please enter you comment here.");
	return false;
}
}