function checkBlank(form)
{
    var value=form.value;
    var len=value.length;
    var InsertedStr="";
    var i;
	
	for (i=0; i<len; i++)
		InsertedStr=InsertedStr+value.charAt(i).replace (" ","")
	
	if (InsertedStr=="")
		return false;
	else
		return true;
}





function check_tel(form)
{
	var check="true";
	var value=form.value;
	var len=value.length;
	var i,n
	
	for (i=0; i<len; i++)
	{
		n=value.charAt(i)
		if (n != '1' && n != "2" && n != "3" && n != "4" && n != "5" && n != '6' && n != "7" && n != "8" && n != "9" && n != "0" )
			check="false";
	}
	if (check=="false")
	{
		alert("Phone number,Fax number and Mobile nubmer must be Number only .");
		form.focus();
		form.select();
	}	
	return check;
}



function checkurl(form) {
 
 
    var check="true";
	var value=form.value;
	var len=value.length;
	var i;

	for (i=0; i<len; i++)
	{
		if (value.charAt(i) == '"' || value.charAt(i) == "'")
			check="false";
	}
	if (check=="false")
	{
		alert("String Can't Contain Double Quote  or Single Quote ");
		form.focus();
		form.select();
	}
    
    else
    {	
 
				  c=form.value;
				  patern=/\./;
				  myarray=c.split(patern);
				  if (c.length!=0){
				  if (myarray.length==3) {
				   if (myarray[0]=="www" && myarray[0].length==3) {
				     if (myarray[1].length>=2) {
					   if (myarray[2].length<=4 && myarray[2].length>=2) {
					   //window.alert ("url is true");
					   }else{
				    	   window.alert ("Please ,Enter extention in 2 or 3 or 4 character  like ('.info','.name','.com','.net','.org','.ed',...).");
				   	   form.focus();
					   form.select();
					   }
					 }else{
				   	   window.alert ("Your Domain Name Must be at last 2 character  like 'www.yourdomain.com'.");
					   form.focus();
					   form.select();
					 }
				   }else{
				   	   window.alert ("Your Domain name must be started with 'www'.");
					   form.focus();
					   form.select();
					   }
				  }else{
				   	   window.alert ("Your domain name must be like 'www.microsoft.com'.");
					   form.focus();
					   form.select();
					   }
				}
				
		}		
}


function check_string(form)
{
	var check="true";
	var value=form.value;
	var len=value.length;
	var i;
	for (i=0; i<len; i++)
	{
		if (value.charAt(i)=='"')
			check="false";
	}
	if (check=="false")
	{
		alert("Double Quotes (\") not allowed.");
		form.focus();
		form.select();
	}
	return check;
}

function check_space(form)
{
	var check_space="true";
	var check_quote="true";
	var value=form.value;
	var len=value.length;
	var i;
	for (i=0; i<len; i++)
	{
		if (value.charAt(i) == " ")
			check_space="false";
		else
			if (value.charAt(i) == '"' || value.charAt(i) == "'")
			check_quote="false";
	}
	if (check_space=="false")
	{
		alert("No Space Please.");
		form.focus();
		form.select();
	}
	else
		if (check_quote=="false")
		{
			alert("String Can't Contain Double Quote \" or single Quote \' ");
			form.focus();
			form.select();
		}
}

function check_number(form)
{
	var check="true";
	var value=form.value;
	var len=value.length;
	var i,n
	if (value=="")
			return;
	for (i=0; i<len; i++)
	{
		n=value.charAt(i)
		if (n != '1' && n != "2" && n != "3" && n != "4" && n != "5" && n != '6' && n != "7" && n != "8" && n != "9" && n != "0")
			check="false";
	}
	if (check=="false")
	{
		alert("Numbers only and no spaces.");
		form.focus();
		form.select();
	}	
	return check;
}

///////////////////////////////////////////////

function check_number_1(form)
{
//baiad number>0 bashad
    
	var check="true";
	var value=form.value;
	if (value=="")
	   {
	    value=0
	   } 
	value=parseInt(value)   
	var len=value.length;
	var i,n
	
	if (value=="0")
		{
		alert("Block nubmer must be specified correctly")
		}
	
	else
	  {
			if (value=="")
					return;
			for (i=0; i<len; i++)
			{
				n=value.charAt(i)
				if (n != '1' && n != "2" && n != "3" && n != "4" && n != "5" && n != '6' && n != "7" && n != "8" && n != "9" && n != "0")
					check="false";
			}
			if (check=="false")
			{
				alert("Numbers only , no spaces ");
				form.focus();
				form.select();
			}	
		}	
	return check;
}



function check_numberonly(form)
{
    
	var check="true";
	var value=form.value;
	alert(value)
	var len=value.length;
	var i,n
	if (value=="")
			return;
	for (i=0; i<len; i++)
	{
		n=value.charAt(i)
		if (n != '1' && n != "2" && n != "3" && n != "4" && n != "5" && n != '6' && n != "7" && n != "8" && n != "9" && n != "0")
			check="false";
	}
	if (check=="false")
	{
		alert("Numbers only.");
		form.focus();
		form.select();
	}	
	return check;
}


function check_blank(form)
{
	var check="true";
	var value=form.value;
	var len=value.length;
	var i,n;
	for (i=0; i<len; i++)
	{
		if (value.charAt(i) == '"' || value.charAt(i) == "'")
			check="false";
	}
	if (check=="false")
	{
		alert("String Can't Contain Double Quote \" or single Quote \' ");
		form.focus();
		form.select();
		return check;
	}

	
	if (value=="")
	{
		check="false";
		alert("This Field can't be blank. ");
		form.focus();
		form.select();
		return check;
	}
	else
	{
		for (i=0; i<len; i++)
		{
			if (value.charAt(i) == '"' || value.charAt(i) == "'")
				check="false";
		}
		if (check=="false")
		{
			alert("String Can't Contain Double Quote \" or single Quote \' ");
			form.focus();
			form.select();
		}
		return check;
		}
}

	  function check_email(form)
		{
		  var check="true";
		  var check_at="false";
		  var check_p="false";
		  var check_cama="true";
		  var check_space="true";
		  var value=form.value;
		  var len=value.length;
		  var i=0,n="";
		  if (value=="")
			return;

		  while (i<len)
		  {
			n=value.charAt(i);
			switch (n)
			{
				case "@":check_at="true";
						 break;
				case ".":check_p="true";
					     break;
				case ",":check_cama="false";
						 break;
				case " ":check_space="false";
						 break;				
			}
		    i++;				
		  }	
		  if(check_p=="false" || check_at=="false" || check_cama=="false")
		  {
			check="false";
			alert("Please enter a valid email address.");
			form.focus();
			form.select();
		  }	
		  else
			{
				if (check_space=="false")
				{
					check="false";
					alert("No Space Please.");
					form.focus();
					form.select();
				}
				else
				{	
					check="true";
				}
			}
		  return check;	
		}
		
	
	
	

	
function check_special(form)
{
	var check="true";
	var value=form.value;
	var len=value.length;
	var i;
	for (i=0; i<len; i++)
	{
		if (value.charAt(i)=='~' || value.charAt(i)=='!' || value.charAt(i)=='@' || value.charAt(i)=='#' || value.charAt(i)=='$' ||  value.charAt(i)=='%' ||  value.charAt(i)=='^' ||  value.charAt(i)=='&' ||  value.charAt(i)=='*' ||  value.charAt(i)=='(' ||  value.charAt(i)==')' ||  value.charAt(i)=='+' ||  value.charAt(i)=='=' ||  value.charAt(i)=='`' ||  value.charAt(i)=='|' ||  value.charAt(i)==']' ||  value.charAt(i)=='[' ||  value.charAt(i)=='}' ||  value.charAt(i)=='{') 
			check="false";
	}
	if (check=="false")
	{
		alert("Don't Use Special Characters.");
		form.focus();
		form.select();
	}
	
	
	for (i=0; i<len; i++)
	{
		if (value.charAt(i)=='"' || value.charAt(i)=="'") 
			check="false2";
	}
	if (check=="false2")
	{
		alert("String Can't Contain Double Quote \" or single Quote \' ");
		form.focus();
		form.select();
	}
	
	
	for (i=0; i<len; i++)
	{
		if (value.charAt(i)=='.' ||  value.charAt(i)==" ") 
			check="false3";
	}
	if (check=="false3")
	{
		alert("String Can't . or space");
		form.focus();
		form.select();
	}
	
	
	return check;
}	

//-------------------------------------------------------------------------------------
function checkmailnewold(s) {
  c=s.value;
  if (c=="")
  {
	return;
  }
  else
  {
  patern=/\@/;
  myarray=c.split(patern);
  if (myarray.length==2) {
    if (myarray[0].length>2 && myarray[1].length!=0) {
	   patern=/\./;
       myarray1=myarray[1].split(patern);
	   if (myarray1.length==2) {
	      if (myarray1[0].length>2) {
		     if (myarray1[1].length>=2 && myarray1[1].length<=4) {
			     temp=0;
			     for (i=0;i<myarray1[1].length;i++){
				     d = myarray1[1].charAt(i);  
                     if ((d >= "0") && (d <= "9")) {
					 temp++;}
					}
					if (temp>0) {
					window.alert("Your Email address extention must be only character ")
					s.focus();
					s.select();
					}else{
					 //   window.alert("Email address is true!")
					}
			 }else
			  {
			  window.alert("Your Email address Extention must be 2-4 character  !")
			  s.focus();
			  s.select();
			  }
		  }else
		   {
		   window.alert("Your domain in Email address must be at least 3 character !")
		   s.focus();
		   s.select();
		   }
	   }else
	     {
	     window.alert("Your Email address must be in this format 'test@test.com' but you typed like 'test@test or test.test@com'!")
	     s.focus();
	     s.select();
	     }
    }
    else
    {
		window.alert("Your username in Email address must be at least 3 character !")
	    s.focus();
	    s.select();
    }
  }else
    {
    window.alert("Your Email address must be in this format 'test@test.com' but you typed like 'test or test@'!")
    s.focus();
	s.select();
    }
}
}

	//-------------------------------------------------------------------------------------
	
function showdesign(lan)
{

var newwindow = '';
var newwindow2 = '';
if (!newwindow.closed && newwindow.location) 
	{
		newwindow.close();
	}
	if (!newwindow2.closed && newwindow2.location)
	{
		newwindow2.location.href ='../pishrohosting/showdesign.asp?lan='+lan
	}
	else
	{
		newwindow2=window.open ('../pishrohosting/showdesign.asp?lan='+lan,'a',"height=550,width=780,left=10,top=20");
		if (!newwindow2.opener) newwindow2.opener = self;
	}
	if (window.focus) {newwindow2.focus()}
	//return false;

}


//-------------------------------------------------------------------------------------





<!-- This script and many more are available free online at -->

<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Original:  Fred P -->

<!-- Begin

// Compare two options within a list by VALUES

function compareOptionValues(a, b) 

{ 

  // Radix 10: for numeric values

  // Radix 36: for alphanumeric values

  var sA = parseInt( a.value, 36 );  

  var sB = parseInt( b.value, 36 );  

  return sA - sB;

}



// Compare two options within a list by TEXT

function compareOptionText(a, b) 

{ 

  // Radix 10: for numeric values

  // Radix 36: for alphanumeric values

  var sA = parseInt( a.text, 36 );  

  var sB = parseInt( b.text, 36 );  

  return sA - sB;

}



// Dual list move function

function moveDualList( srcList, destList, moveAll ) 

{

  // Do nothing if nothing is selected

  if (  ( srcList.selectedIndex == -1 ) && ( moveAll == false )   )

  {

    return;

  }



  newDestList = new Array( destList.options.length );



  var len = 0;



  for( len = 0; len < destList.options.length; len++ ) 

  {

    if ( destList.options[ len ] != null )

    {

      newDestList[ len ] = new Option( destList.options[ len ].text, destList.options[ len ].value, destList.options[ len ].defaultSelected, destList.options[ len ].selected );

    }

  }



  for( var i = 0; i < srcList.options.length; i++ ) 

  { 

    if ( srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) )

    {

       // Statements to perform if option is selected



       // Incorporate into new list

       newDestList[ len ] = new Option( srcList.options[i].text, srcList.options[i].value, srcList.options[i].defaultSelected, srcList.options[i].selected );

       len++;

    }

  }



  // Sort out the new destination list

  newDestList.sort( compareOptionValues );   // BY VALUES

  //newDestList.sort( compareOptionText );   // BY TEXT



  // Populate the destination with the items from the new array

  for ( var j = 0; j < newDestList.length; j++ ) 

  {

    if ( newDestList[ j ] != null )

    {

      destList.options[ j ] = newDestList[ j ];

    }

  }



  // Erase source list selected elements

  for( var i = srcList.options.length - 1; i >= 0; i-- ) 

  { 

    if ( srcList.options[i] != null && ( srcList.options[i].selected == true || moveAll ) )

    {

       // Erase Source

       //srcList.options[i].value = "";

       //srcList.options[i].text  = "";

       srcList.options[i]       = null;

    }

  }
}

//------------------------------------------------------------------------------------------------
function selectdesign(resid,sitename)
{

   window.open ('../templates/showdesign.asp?resid='+resid+'&sitename='+sitename,'a',"height=550,width=650,left=10,top=20");
  // document.location.href='../templates/showdesign.asp?resid='+resid
}



function showsite(resid,sitename)
{
var newwindow = '';
var newwindow2 = '';
if (!newwindow.closed && newwindow.location) 
	{
		newwindow.close();
	}
	if (!newwindow2.closed && newwindow2.location)
	{
		newwindow2.location.href ='../templates/sitemap.asp?resid='+resid+'&sitename='+sitename+'&change=yes'
	}
	else
	{
		newwindow2=window.open ('../templates/sitemap.asp?resid='+resid+'&sitename='+sitename+'&change=yes','a',"height=550,width=780,left=10,top=20");
		if (!newwindow2.opener) newwindow2.opener = self;
	}
	if (window.focus) {newwindow2.focus()}
	//return false;

}



//function showsite(resid,sitename)
 //{ 
   //  alert("a")
  //    window.open ('../templates/sitemap.asp?resid='+resid+'&sitename='+sitename+'&change=yes','a',"height=550,width=780,left=10,top=20");
//    document.location.href='../templates/sitemap.asp?resid='+resid+'&sitename='+sitename+'&change=yes'
 //}


function winclose()
{
   
   self.parent.location="exituser.asp"

}

 function f_back()
 {
   document.location.href="../admin/finishdesign.asp";
 }
 
 function f_back1()
 {
   document.location.href="../admin/restaurantlist.asp";
 }
 
 
  function f_back2(resid)
 {
//  alert(other)
  document.location.href="food.asp?resid="+resid;
 }

function wclose()
{
self.parent.location="finish.asp"
} 





function wclose2(resid)
{
  // alert("close")
 //  self.opener.f_back2(resid);
   window.close();
}

function wclose3()
{
 //  alert("close3")
 //  self.opener.f_back2(resid);
   window.close();
}

///////////////////////////////////////////


function backfoodtype(typecd)
 {

  document.location.href="foodtypedetail.asp?typecd="+typecd;
 }
///////////////////////////////
 
function closefoodtype(typecd)
{
 
   self.opener.backfoodtype(typecd);
   window.close();
}


/*
function verifyEmail1(form)
{
checkEmail = form.value

if ((checkEmail.indexOf('@') < 0) || ((checkEmail.charAt(checkEmail.length-4) != '.') && (checkEmail.charAt(checkEmail.length-3) != '.'))) 
{alert("You have entered an invalid email address. Please try again.");
//checkEmail.select();
return false;
} 

else {
//form.method="get";
//form.target="_self";
//form.action="myscript.cgi";
//form.submit();
}

}*/


///////////////////////////////////////
/*function verifyEmail2(form) {
	var rejectedDomain=new Array()
	var index=0;
	rejectedDomain[index++]="hotmail"
	rejectedDomain[index++]="rocketmail"
	rejectedDomain[index++]="yahoo"
	rejectedDomain[index++]="zdnetmail"

	var rejected=false
	var testresults=true
	var str=form.email.value
	var filter=/^.+@.+\..{2,3}$/
	if (filter.test(str)){
		var tempstring = str.split("@")
		tempstring = tempstring[1].split(".")
		for (i=0; i<rejectedDomain.length; i++) {
			if (tempstring[0]==rejectedDomain[i])
			rejected=true
		}
		if (rejected) {
			var message="Please input a more official email address!\n"
			message += "The following addresses are not allowed:\n"
			for (i=0; i<rejectedDomain.length; i++) {
				message += "\t" + rejectedDomain[i] + "\n"
			}
			validatePrompt(form.email, message)
			testresults=false
		}
	} else {
		message="Please input a complete and valid email address!"
		validatePrompt(form.email, message)
		testresults=false
	}
	return (testresults)
}*/

//////////////////////////////////////

function checkmailnew(Form)
{
  if  (Form.value!='')
  {
   if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(Form.value))
   {
      check="True"
   }
   else
   {
    check="False"
   }
   
   if (check=="False")
    {
     alert("Invalid E-mail Address! Please re-enter.")
     Form.focus();
	 Form.select();
	}	
   
    return check;
  }
  
}

    // ************************************************************************//
    // ************************************************************************//
    // ************************************************************************//
    // ************************************************************************//

function picture(actionflag,newsid)
{
  var newwindow = '';
  var newwindow2 = '';
  if (!newwindow.closed && newwindow.location) 
	{
		newwindow.close();
	}
	if (!newwindow2.closed && newwindow2.location)
	{
		newwindow2.location.href ='addpicture.asp?actionflag='+actionflag+'&newsid='+newsid
	}
	else
	{
		newwindow2=window.open ('addpicture.asp?actionflag='+actionflag+'&newsid='+newsid,'a',"height=250,width=500,left=10,top=20");
		if (!newwindow2.opener) newwindow2.opener = self;
	}
	if (window.focus) {newwindow2.focus()}
	//return false;
	
  //window.open ('addpicture.asp?actionflag='+actionflag,'a',"height=250,width=500,left=10,top=20");
}

        //////////////////////////////////////////////////////////
function delimg(newsid,actionflag)
{
   x=window.confirm ("Are you sure you want to delete the picture?");
	if (x==true)
	{ 
	 var newwindow = '';
  var newwindow2 = '';
  if (!newwindow.closed && newwindow.location) 
	{
		newwindow.close();
	}
	if (!newwindow2.closed && newwindow2.location)
	{
		newwindow2.location.href ='addpicture-pr.asp?newsid='+newsid+'&actionflag='+actionflag
	}
	else
	{
		newwindow2=window.open ('addpicture-pr.asp?newsid='+newsid+'&actionflag='+actionflag,'a',"height=250,width=500,left=10,top=20");
		if (!newwindow2.opener) newwindow2.opener = self;
	}
	if (window.focus) {newwindow2.focus()}

	}
}

         //////////////////////////////////////////////////////////
function tecpicture(newsid)
{
  actionflag="tec-updtpic"
  var newwindow = '';
  var newwindow2 = '';
  if (!newwindow.closed && newwindow.location) 
	{
		newwindow.close();
	}
	if (!newwindow2.closed && newwindow2.location)
	{
		newwindow2.location.href ='addpicture.asp?actionflag='+actionflag+'&newsid='+newsid
	}
	else
	{
		newwindow2=window.open ('addpicture.asp?actionflag='+actionflag+'&newsid='+newsid,'a',"height=250,width=500,left=10,top=20");
		if (!newwindow2.opener) newwindow2.opener = self;
	}
	if (window.focus)
	 {
	 newwindow2.focus()
	 }
	
}

//////////////////////////////////////////////////////////
      
function delimgtec(newsid,actionflag)
{
   x=window.confirm ("Are you sure you want to delete the picture?");
	if (x==true)
	{ 
	   document.location.href='addpicture-pr.asp?newsid='+newsid+'&actionflag='+actionflag
	}
}

               

 ////////////////////////////////////////////////////////////////////
function newslistopener(newsid)
{
  document.location.href='readnewsdetail.asp?newsid='+newsid+'&msg=addpic' 
}
 


function grouppicture(id)
{
  var newwindow = '';
  var newwindow2 = '';
  if (!newwindow.closed && newwindow.location) 
	{
		newwindow.close();
	}
	if (!newwindow2.closed && newwindow2.location)
	{
		newwindow2.location.href ='addgrouppicture.asp?id='+id
	}
	else
	{
		newwindow2=window.open ('addgrouppicture.asp?id='+id,'a',"height=250,width=500,left=10,top=20");
		if (!newwindow2.opener) newwindow2.opener = self;
	}
	if (window.focus) {newwindow2.focus()}
}



function sendpage()
{
  var newwindow = '';
  var newwindow2 = '';
  if (!newwindow.closed && newwindow.location) 
	{
		newwindow.close();
	}
	if (!newwindow2.closed && newwindow2.location)
	{
		newwindow2.location.href ='sendpage.asp'
	}
	else
	{
		newwindow2=window.open ('sendpage.asp','a',"height=250,width=350,left=10,top=20");
		if (!newwindow2.opener) newwindow2.opener = self;
	}
	if (window.focus) {newwindow2.focus()}
}

    // ************************************************************************//
    // ************************************************************************//
    // ************************************************************************//
    // ************************************************************************//

function menupicture()
{
  var newwindow = '';
  var newwindow2 = '';
  if (!newwindow.closed && newwindow.location) 
	{
		newwindow.close();
	}
	if (!newwindow2.closed && newwindow2.location)
	{
		newwindow2.location.href ='menupicture.asp'
	}
	else
	{
		newwindow2=window.open ('menupicture.asp','a',"height=250,width=500,left=10,top=20");
		if (!newwindow2.opener) newwindow2.opener = self;
	}
	if (window.focus) {newwindow2.focus()}
	//return false;
	
  //window.open ('menupicture.asp','a',"height=250,width=500,left=10,top=20");
}

    // ************************************************************************//
    // ************************************************************************//
    // ************************************************************************//
    // ************************************************************************//
function checknull(reqFlds,reqFldsName,form)
{
   
	errors="";
	reqFldsName=reqFldsName.split(",")
	reqFldsArr=reqFlds.split(",")
	
	for (i=0;i<reqFldsArr.length;i++)
	{
		eval('xx='+form+'.'+reqFldsArr[i]+'.value')
		xx=xx.replace(" ","")
		if (xx=="")
			errors +="-"+reqFldsName[i]+"\n";
	}
	if (errors=="") 
	{
		eval(form+'.submit();')
	}
	else
		alert("Following field(s) must be filled:\n\n"+errors)
}



function moveSelected (select, down) 
{
  if (select.selectedIndex != -1) 
    {
    if (down) 
		{
      if (select.selectedIndex != select.options.length - 1)
        var i = select.selectedIndex + 1;
      else
        return;
		}
    else 
		{
      if (select.selectedIndex != 0)
        var i = select.selectedIndex - 1;
      else
        return;
		}
    var swapOption = new Object();
    swapOption.text = select.options[select.selectedIndex].text;
    swapOption.value = select.options[select.selectedIndex].value;
    swapOption.selected = select.options[select.selectedIndex].selected;
    swapOption.defaultSelected = select.options[select.selectedIndex].defaultSelected;
    for (var property in swapOption)
      select.options[select.selectedIndex][property] = select.options[i][property];
    for (var property in swapOption)
      select.options[i][property] = swapOption[property];
   }
}




function check_string2(form)
{
	var check="true";
	var value=form.value;
	var len=value.length;
	var i;

	for (i=0; i<len; i++)
	{
		if (value.charAt(i) == '"' || value.charAt(i) == "'")
			check="false";
	}
	if (check=="false")
	{
		alert("String Can't Contain Double Quote  or Single Quote ");
		form.focus();
		form.select();
	}
	return check;
}


// ************************************************************************//
    // ************************************************************************//
    // ************************************************************************//
    // ************************************************************************//

function winfile(newsid,blockid,filetype,row)
{
  var newwindow = '';
  var newwindow2 = '';
  if (!newwindow.closed && newwindow.location) 
	{
		newwindow.close();
	}
	if (!newwindow2.closed && newwindow2.location)
	{
		newwindow2.location.href ='winfile.asp?newsid='+newsid+'&blockid='+blockid+'&filetype='+filetype+'&row='+row
	}
	else
	{
		newwindow2=window.open ('winfile.asp?newsid='+newsid+'&blockid='+blockid+'&filetype='+filetype+'&row='+row,'a',"height=200,width=350,left=10,top=20");
		if (!newwindow2.opener) newwindow2.opener = self;
	}
	if (window.focus) {newwindow2.focus()}

}

/////////////////////////////////////////////////////////////
function winfileclose(row,filetype,ext)
{
eval('document.form1.'+filetype+'Sel'+row+'.checked=true')
eval('document.form1.hid'+filetype+'Sel'+row+'.value="on"')
eval('document.form1.'+filetype+'Ext'+row+'.value=ext')
}

// ************************************************************************//
// ************************************************************************//
// ************************************************************************//
// ************************************************************************//

function showfile(row,filename,filetype,secid)
{
  var newwindow = '';
  var newwindow2 = '';
  if (!newwindow.closed && newwindow.location) 
	{
		newwindow.close();
	}
	if (!newwindow2.closed && newwindow2.location)
	{
		newwindow2.location.href ='showfile.asp?filetype='+filetype+'&row='+row+'&filename='+filename+'&secid='+secid	
	}
	else
	{
	  if (filetype=="I")
	   {
		newwindow2=window.open ('showfile.asp?filetype='+filetype+'&row='+row+'&filename='+filename+'&secid='+secid,'a',"height=400,width=500,left=10,top=20,scrollbars=yes,toolbar=no,menubar=no,resizable=yes");
	   }	
	  if (filetype=="V")
	   {
		newwindow2=window.open ('showfile.asp?filetype='+filetype+'&row='+row+'&filename='+filename,'a',"height=500,width=500,left=10,top=20");
	   }	
	  if (filetype=="A")
	   {
		newwindow2=window.open ('showfile.asp?filetype='+filetype+'&row='+row+'&filename='+filename,'a',"height=150,width=400,left=10,top=20");
	   }	
	  if (filetype=="F")
	   {
		newwindow2=window.open ('showfile.asp?filetype='+filetype+'&row='+row+'&filename='+filename,'a',"height=300,width=400,left=10,top=20");
	   }	
	
	   
		if (!newwindow2.opener) newwindow2.opener = self;
	}
	if (window.focus) {newwindow2.focus()}

}


/////////////////////////////////////////////////////////////
function showfileclose(row,filetype)
{
eval('document.form1.'+filetype+'Sel'+row+'.checked=false')
eval('document.form1.hid'+filetype+'Sel'+row+'.value=""')
eval('document.form1.'+filetype+'F'+row+'.value=""')
eval('document.form1.'+filetype+'U'+row+'.value=""')
}


// ************************************************************************//
// ************************************************************************//
// ************************************************************************//
// ************************************************************************//

function showfiletitle(filename,filetype)
{
  var newwindow = '';
  var newwindow2 = '';
  if (!newwindow.closed && newwindow.location) 
	{
		newwindow.close();
	}
	if (!newwindow2.closed && newwindow2.location)
	{
		newwindow2.location.href ='showfiletitle.asp?filetype='+filetype+'&filename='+filename	
	}
	else
	{
	 
	  if (filetype=="V")
	   {
		newwindow2=window.open ('showfiletitle.asp?filetype='+filetype+'&filename='+filename,'a',"height=500,width=500,left=10,top=20");
	   }	
	  if (filetype=="A")
	   {
		newwindow2=window.open ('showfiletitle.asp?filetype='+filetype+'&filename='+filename,'a',"height=150,width=400,left=10,top=20");
	   }	
	  if (filetype=="F")
	   {
		newwindow2=window.open ('showfiletitle.asp?filetype='+filetype+'&filename='+filename,'a',"height=300,width=400,left=10,top=20");
	   }	
	
	   
		if (!newwindow2.opener) newwindow2.opener = self;
	}
	if (window.focus) {newwindow2.focus()}

}


// ************************************************************************//
// ************************************************************************//
// ************************************************************************//
// ************************************************************************//

function showfileuser(filename,filetype)
{

  var newwindow = '';
  var newwindow2 = '';
  if (!newwindow.closed && newwindow.location) 
	{
		newwindow.close();
	}
	if (!newwindow2.closed && newwindow2.location)
	{
		newwindow2.location.href ='admin/showfiletitle.asp?filetype='+filetype+'&filename='+filename	
	}
	else
	{
	 
	  if (filetype=="V")
	   {
		newwindow2=window.open ('admin/showfiletitle.asp?filetype='+filetype+'&filename='+filename,'a',"height=500,width=500,left=10,top=20");
	   }	
	  if (filetype=="A")
	   {
		newwindow2=window.open ('admin/showfiletitle.asp?filetype='+filetype+'&filename='+filename,'a',"height=150,width=400,left=10,top=20");
	   }	
	   
	   
	   if ((filetype=="UA") || (filetype=="UB"))
	   {
	    if (filetype=="UA")
		{
		  document.location.href="audionews.asp?menucode=audionews"
		}
	
		newwindow2=window.open ('admin/showfiletitle.asp?filetype='+filetype+'&filename='+filename,'a',"height=150,width=400,left=10,top=20");
	   }	 
	   
	   
	   
	    if (filetype=="UC")
		   newwindow2=window.open ('showfiletitle.asp?filetype='+filetype+'&filename='+filename,'a',"height=150,width=400,left=10,top=20");
	  	 
	   
	   
	  if (filetype=="F")
	   {
		newwindow2=window.open ('admin/showfiletitle.asp?filetype='+filetype+'&filename='+filename,'a',"height=300,width=400,left=10,top=20");
	   }	
	   
	   if (filetype=="I")
	   {
		newwindow2=window.open ('admin/showfiletitle.asp?filetype='+filetype+'&filename='+filename,'a',"height=550,width=500,left=10,top=10,scrollbars=yes");
	   }	 
	
	   
		if (!newwindow2.opener) newwindow2.opener = self;
	}
	if (window.focus) {newwindow2.focus()}

}

function textCounter(field, maxlimit) {
if (field.value.length > maxlimit) // if too long...trim it!
field.value = field.value.substring(0, maxlimit);
}
function checkQuotation(form) {
 
 
    var check="true";
	var value=form.value;
	var len=value.length;
	var i;

	for (i=0; i<len; i++)
	{
		//if (value.charAt(i) == '"' || value.charAt(i) == "'")
		if (value.charAt(i) == "'")
			check="false";
	}
	if (check=="false")
	{
		alert("Single Quotation(') Warning!");
		form.focus();
		form.select();
	}
}