function enlarge(LImg)
{
myWindow = window.open("","", 'width=1,height=1,top=10,left=10,toolbar=no,scrollbars=yes')
myWindow.document.write("<html><head><title>Large View</title></head>")
myWindow.document.write("<body leftmargin=0 topmargin=0 marginwidth=0 marginheight=0 onload='window.resizeTo(img.width+50,img.height+90);'>")
myWindow.document.write("<div align=Center><img  src='"+ LImg +"'  id='img'></body></html>")
myWindow.document.close()
}

function changeSize(id, valueHeight) {
	document.getElementById(id).style.height = valueHeight + 'px';
}

function commonvalid(fldarr){
 for(i=0;i<fldarr.length;i++){
    if(fldarr[i].indexOf('@') != -1){
       var getmail=fldarr[i].substring(1,fldarr[i].length);
      if (echeck(document.getElementById(getmail).value)==false){
         alert('Invalid Email !');
         document.getElementById(getmail).focus();
         return false;
       }
    }
    else {
      if(document.getElementById(fldarr[i]).value==""){
        alert('required field!');
        document.getElementById(fldarr[i]).focus();
        return false;
        }
     }
  }  
}
function reloadimg(){var myimg=new Array("0.jpg","1.jpg","2.jpg","3.jpg","4.jpg","5.jpg","6.jpg","7.jpg","8.jpg","9.jpg");var myval=new Array("2dW76e","S8Z23p","jRv5X1","re7r1Z","92ViQ5","Oc7MK3","u7F2jL","753YtA","7sDf2J","pP6b8B");var nfinal=Math.floor(Math.random()*9);document.getElementById('SecImg').style.backgroundImage = 'url(asset/'+myimg[nfinal]+')';document.getElementById('SecImg').style.backgroundRepeat='no-repeat';document.getElementById('SecKey1').value=myval[nfinal];}    
//var iChars = "!@#$%^&*()+=[]\\\;/{}|\":<>?";
var iChars = "<>";
function chkjerms(f1){
  for (var i = 0; i < f1.length; i++) {
  	if (iChars.indexOf(f1.charAt(i)) != -1) {
  	//alert ("Your username has special characters. \nThese are not allowed.\n Please remove them and try again.");
  	return false;
  	}
  }
}

//onKeyPress="return numbersonly(event);"
function numbersonly(e){
        var unicode=e.charCode? e.charCode : e.keyCode
        // if (unicode!=8||unicode!=9)
        if (unicode<8||unicode>9)
            {
            //if (unicode!=46){ //if not dot(.) (allowed)
              if (unicode<48||unicode>57) //if not a number
              return false //disable key press
            //}
        }
    } 
 function numberswithdot(e){
        var unicode=e.charCode? e.charCode : e.keyCode
        // if (unicode!=8||unicode!=9)
        if (unicode<8||unicode>9)
            {
            if (unicode!=46){ //if not dot(.) (allowed)
              if (unicode<48||unicode>57) //if not a number
              return false //disable key press
            }
        }
    }    
function isnumber(str)
{	
	for(i=0;i<str.length;i++)
	{ 
	if(((str.substring(i,i+1)>'9')||(str.substring(i,i+1)<'0'))&&(str.substring(i,i+1)!='.')) 
	{
	if((str.substring(i,i+1)=='.'))
	{
	}
	else
	{
	return false;
	break;
	}
	}
	}
	return true;
}
function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){		   
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){		  
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){		    
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){		    
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){		    
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){		   
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){		    
		    return false
		 }
 		 return true					
	}	

  	
function textCounter(field,cntfield,maxlimit) {
    if (field.value.length > maxlimit) // if too long...trim it!
    field.value = field.value.substring(0, maxlimit);
    // otherwise, update 'characters left' counter
    else
    cntfield.value = maxlimit - field.value.length;
 }
function rndbanner(){
  var ilen=7;
  var bnrimg=new Array()
  for (i=1;i<=ilen;i++)
         bnrimg[i]="bnr"+i+".jpg";

  var dpn=Math.floor(Math.random()*bnrimg.length);

  if (dpn==0) {     dpn=1; }
     document.write('<img src="images/'+bnrimg[dpn]+'" border=0>');
}
function mysubmit(frmname){
   //document.frmreg.submit();
   document.getElementById(frmname).submit();
   return true;
}

function hlight(nn){
  document.getElementById(nn).style.backgroundColor="#dedede";
 }
function llight(nn,bgg){
  document.getElementById(nn).style.backgroundColor=bgg;
 }

/* To Use this function you have to put required as starting of  anf textbox field.
  And put checkrquired(this) in submit button.	*/
function checkrequired(which) {
var blneCheck=false;
var pass=true;
if (document.images) 
{
  for (i=0;i<which.length;i++) 
	{
	var tempobj=which.elements[i];	
	if (tempobj.name.substring(0,8)=="required") 
		{		
		if (((tempobj.type=="text"||tempobj.type=="textarea")&&
		tempobj.value=='')||(tempobj.type.toString().charAt(0)=="s"&&
		tempobj.selectedIndex==0)) 
			{
				pass=false;
				break;
			}
		}
   
	if (tempobj.name.substring(0,8)=="erequire") 
		{			
			if(tempobj.type=="text" && tempobj.value=='')
			{
				pass=false;
				break;
			}			
			else 
			{
				if(echeck(tempobj.value)==false)
				{						
					blneCheck=true;
					pass=false;
					break;					
				}
			 }					        
		}
	}
 }  

if (!pass) 
{

   if (tempobj.name.substring(0,8)=="required")
   {			
		shortFieldName=tempobj.name.substring(8,30).toUpperCase();		
		tempobj.focus();
		alert("Please make sure the "+shortFieldName+" field was properly completed.");
		return false;
	}
	if (tempobj.name.substring(0,8)=="erequire") 
	{
		if(!blneCheck)
		{
			shortFieldName=tempobj.name.substring(8,30).toUpperCase();
			tempobj.focus();
			alert("Please make sure the "+shortFieldName+" field was properly completed.");	
			return false;
		}
		else
		{
			shortFieldName=tempobj.name.substring(8,30).toUpperCase();
			tempobj.focus();
			alert("Please make sure email address in "+shortFieldName+" was properly completed.");	 
			return false;
		}
    }
}  
else
{
	return true;
}
	
}

function redirectToHttps(pgname) 
{ 
    if(document.location.protocol=="http:")
    {
        //var httpURL = window.location.hostname + window.location.pathname; 
        //var httpURL = window.location.hostname + pgname; 
        //var httpsURL = "https://" + httpURL ; 
        // alert(pgname);
         var httpsURL = "https://maxvps011.maximumasp.com/V011U47FUD"+ pgname; 
         window.location = httpsURL ; 
    }
} 
function redirectToHttpORG(pgname,siteURL) 
{ 
    if(document.location.protocol=="https:")
    {
        //var httpURL = window.location.hostname + window.location.pathname; 
        //var httpURL = window.location.hostname + pgname; 
        //var httpsURL = "http://" + httpURL ; 
        var httpsURL = siteURL+pgname ; 
        window.location = httpsURL ; 
    }
    /*if(window.location.pathname.indexOf("bloomstore")>0){
        var httpsURL = siteURL+pgname ; 
        window.location = httpsURL ; 
    }*/
} 
function mybookmark(){
    /*var txt = "Bookmark Us!";
    var url = "http://www.getontheflist.com";
    var who = "GetonTheFlist";

    var ver = navigator.appName;
    var num = parseInt(navigator.appVersion);
    if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
    document.write('<A HREF="javascript:window.external.AddFavorite(url,who);" ');
    document.write('onMouseOver=" window.status=');
    document.write("txt; return true ");
    document.write('"onMouseOut=" window.status=');
    document.write("' '; return true ");
    document.write('">'+ txt + '</a>');
    }else{
    txt += "  (Ctrl+D)";
    document.write(txt);
    } 
   */
  
}
 var urlAddress = "http://www.getontheflist.com/welcome.asp"; 
   var pageName = "Welcome on F list"; 
    function addToFavorites() { 
      var ver = navigator.appName;
    var num = parseInt(navigator.appVersion);
    if ((ver == "Microsoft Internet Explorer")&&(num >= 4)) {
          if (window.external) { window.external.AddFavorite(urlAddress,pageName) 
           }
           else { alert("Sorry! Your browser doesn't support this function.");  }
        }
      else {
            if(window.sidebar && sidebar.addPanel) { // add to FF bookmarks
                window.sidebar.addPanel(pageName,urlAddress,''); 
              }
              else { alert("Sorry! Your browser doesn't support this function.");  }
         }     
    }
    function checkAll(n,frmname) 
		{
			temp = document.frmemail.elements.length;                     
			for (i=0; i < temp; i++)
			{  
			   document.frmemail.elements[i].checked=n;				
			}
		} 
   function composemail(n) 
	{
		temp = document.frmemail.elements.length;                     			
		for (i=0,count=0; i < temp; i++)
		{ 
	  	    if(document.frmemail.elements[i].checked)
			{			      
			    count++;			  
			}				  
		}
		if(count==0)		
		{			   
			alert('No Record Selected.')			   
			return false;
		}
		else
		{
			if(confirm('Are you sure you want to select for email. Please ok to enter cancel to exit immediately'))
			{
					document.frmemail.method="Post"
					document.frmemail.action="addemail.asp?eid="+document.getElementById('eid').value;  
					document.frmemail.submit();
			}
		}
	} 
function admincomposemail(n,etype) 
	{
		temp = document.frmemail.elements.length;                     			
		for (i=0,count=0; i < temp; i++)
		{ 
	  	    if(document.frmemail.elements[i].checked)
			{			      
			    count++;			  
			}				  
		}
		if(count==0)		
		{			   
			alert('No Record Selected.')			   
			return false;
		}
		else
		{
			if(confirm('Are you sure you want to select for email. Please ok to enter cancel to exit immediately'))
			{
					document.frmemail.method="Post"
					document.frmemail.action="sendapremail.asp?etype="+etype;  
					document.frmemail.submit();
			}
		}
	} 	
function giftvalide(rdname){
    var abr=0;
    var nlen=document.getElementById("frmreg").length;
    for (var i=0; i <nlen ; i++)
    {
       var tempobj=document.getElementById("frmreg").elements[i];	
        if (tempobj.name==rdname) {
			if(tempobj.checked==true)										
					abr =abr + 1 ;
		}
     }
      if(abr==0)
        {
        alert('please select '+rdname);
        document.getElementById('stay').focus();
        return false;
        }
    document.frmreg.submit();     
   return true;
  }	
  function cartvalide(ty1){
     document.frmreg.action="giftfinder7.asp?submit=t&t="+ty1; 
     document.frmreg.submit();
     return true;
     //return false;
  }	
 function ingshow(myid) {
   document.getElementById('ing_'+myid).style.display="inline";
   //document.getElementById('ing_'+myid).style.posit
 }
 function changefuji(myid) {
    //ncnt=6;
    ncnt=document.getElementById("holycnt").value;
    for (var i=1; i <=ncnt ; i++)   {
        document.getElementById('holy_'+i).style.display="none";
     }
     if(myid>0)
       document.getElementById('holy_'+myid).style.display="inline";
     
     
 }
function myPopUp(wt,ht,ppt)
{
  window.open(ppt,null,'width='+wt+',height='+ht+',status= no, resizable= no, scrollbars=no, toolbar=no,location=center,menubar=no, top=20, left=100');
}