//LOGIN CODING-----------------------------------------------------------
	
	
	
	/* querystring.js - Contains functions to extract querystring parameters from URL
The parameters are loaded into the associative array queryString[].*/

//In open JavaScript (not inside a function), define the array
var queryString = new Array();
// and then pull the querystyring parameters from the URL.
// The search property of the window location returns the query string.
// The method substring(1) removes the first character (the question mark).
// The split function then copies the parameters into an array called "parms"
function getqryparam()
{
var parameters = window.location.search.substring(1).split('&');
// For each element in the array, find the equal sign that separates the parameter
// name from the parameter value.  If there is one, divide the expression into
// the parameter name
for (var i=0; i<parameters.length; i++) {
    var pos = parameters[i].indexOf('=');
    // If there is an equal sign, separate the parameter into the name and value,
    // and store it into the queryString array.
    if (pos > 0) {
        var paramname = parameters[i].substring(0,pos);
        var paramval = parameters[i].substring(pos+1);
        queryString[paramname] = unescape(paramval.replace(/\+/g,' '));
    } else {
        //special value when there is a querystring parameter with no value
        queryString[parameters[i]]="" 
    }
}
}
	
function querySt()
{
hu = window.location.search.substring(1);
gy = hu.split("&");
for (i=0;i<gy.length;i++) 
{
ft = gy[i].split("=");

return ft[1];

}
}

	function AssignFileVal()
		{
			var fname =document.uploadandcontnieform.filemain.value;
					//	alert(fname+"jj");
					if(fname=='')
					{
						alert('Kindly select file.');
					return false;	
					}
					else 
					{
							return true;		
					}
		//	document.q_form.ffile.value=fname;
					//	alert(document.q_form.ffile.value);
		//	document.q_form.divfname.value=fname;
				//	alert(document.q_form.divfname.value);

				
				//alert(document.q_form.ffile.value+'yes');
			//document.forrms[0].text.value=fname;
		//	q_form.elements['ffile'].value=fname;
//q_form.elements['ffile'].value=fname;
//q_form.elements['divfname'].value=fname;
			//	document.q_form.divfname.value=fname;
			
			//alert(document.q_form.ffile.value);
		//window.location='http://localhost/Photostouchup/upload-continue.asp;
		//alert(fname);

		}
		
		
		
		function ValidatePassFail(User,Pass)
			{
				var GetUser=document.getElementById(User);
				var GetPass=document.getElementById(Pass);
				if(GetUser.value =="")
				{
					alert("Code can not be left blank")
					GetUser.focus();
					return false;
				}
				else if(GetPass.value =="" )
				{
					alert("Password can not be left blank")
					GetPass.focus();
					return false;
				}
				else
				{
				return true;
				}

			}

			function SetFocus()
			{
				document.LoginForm.uname.focus();
			}

		function login()
		{

			str = new String(document.LoginForm.uname.value)


			        str = str.substr((str.length-3),str.length);
					if(str=="r2v" || str=="r2v")
					{

			           return true;
			        }
			        else
			        {
			        	alert("Invalid Code");
			        	document.LoginForm.uname.focus();
			         	return false;
					}


			return false;

		}

		function forget()
		{
			window.open("forget.asp","Print","top=5,left=30,toolbars=no,maximize=yes,resize=yes,width=370,height=250,location=no,directories=no,scrollbars=yes");
		}
//BOOKMARK CODING-----------------------------------------------------------

 function bookmark() {
 title = "Raster2Vector"; 
 url = "http://www.rastertovector.biz/";

	if (window.sidebar) { // Mozilla Firefox Bookmark

		window.sidebar.addPanel(title, url,"");

	} else if( window.external ) { // IE Favorite

		window.external.AddFavorite( url, title); }

	else if(window.opera && window.print) { // Opera Hotlist

		return true; }

 }
//Images - PRE-LOADER CODING------------------

<!--
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];}
}
//-->

// quick form coading

function onkeyPress(e)
{
    var key = window.event ? e.keyCode : e.which;
    if (key == 13)
    StartClick();
    e.cancelBubble = true;
    e.returnValue = false;
    return false;
}

function checkspecial(checkfield)
{
 	var iChars = "!%^[]\\\`/{}|\'~:<>?";
	for (var i = 0; i < checkfield.length; i++)
	{
		if (iChars.indexOf(checkfield.charAt(i)) != -1)
		{
			//alert("yes")
			return true;
		}			
	}					
}

function resetquick()
{
	document.q_form.reset();	
	GenNewCap();	
}
function echeck(str)
{
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	//alert(str.indexOf(dot));
	//alert(lstr);
	if (str.indexOf(at)==-1)
	{
	   alert("Invalid E-mail ID");
	   return false;
	}
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
	{
	   alert("Invalid E-mail ID");
	   return false;
	}
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==(lstr-1))
	{
		alert("Invalid E-mail ID");
		return false;
	}
	 if (str.indexOf(at,(lat+1))!=-1)
	 {
		alert("Invalid E-mail ID");
		return false;
	 }
	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
	 {
		alert("Invalid E-mail ID");
		return false;
	 }
	 if (str.indexOf(dot,(lat+2))==-1)
	 {
		alert("Invalid E-mail ID");
		return false;
	 }
	 if (str.indexOf(" ")!=-1 || str.indexOf("!")!=-1 || str.indexOf("?")!=-1 || str.indexOf("$")!=-1 || str.indexOf("^")!=-1 || str.indexOf("*")!=-1 || str.indexOf("{")!=-1)
	 {
		alert("Invalid E-mail ID");
		return false;
	 }
	 return true;
}
function check_quick()
{
	
var emailID=document.q_form.email;
 var	msg='';
 

if (document.q_form.filemain.value == "")
    {
	    msg+=("Please Browse Your File.\r\n");		
	    document.q_form.filemain.focus();
	 //   return false;
    }	
		
	 if (document.q_form.name.value == "")
    {
	        msg+=("Please Enter Your Name.\r\n");		
	    document.q_form.name.focus();
	   // return false;
    }
	
	 if (document.q_form.phone.value == "")
    {
	        msg+=("Please Enter Your Phone No.\r\n");		
	    document.q_form.phone.focus();
	   // return false;
    }	

     if ((emailID.value==null)||(emailID.value==""))
	{
		    msg+=("Please Enter your E-mail ID\r\n");		
		emailID.focus();
		//return false
	}
	else 
	{
		var	 string=emailID.value;
	if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) 
!= -1)
	{
		
	}
		else
	{
			  msg +=("Please Enter Valid E-mail ID\r\n");	
	}
		emailID.focus();
		//return false
	}    
	
	 if (document.q_form.company.value == "")
    {
	     msg +=("Please Enter Your Company.\r\n");		
	    document.q_form.company.focus();
	   // return false;
    }	
	

 if (document.q_form.Dist_country.value == "-Select Country-")
    {
	     msg +=("Please Select Your Country.\r\n");		
	    document.q_form.Dist_country.focus();
	  //  return false;
    }
	 if (document.q_form.RadioButt_hear_abt.value == "No")
    {
	     msg +=("Please Select Source.\r\n");		
	    document.q_form.RadioButt_hear_abt.focus();
	  //  return false;
    }
	 if(document.getElementById("testtext").value=="")
	{
		 msg +=("Please Enter The Verification Code!\r\n");
		document.getElementById("testtext").focus();
		//return false;
	}
	else if(document.getElementById("holdCAP").value.toLowerCase()!=document.getElementById("testtext").value.toLowerCase())
	{
		 msg +=("Sorry That Was Not The Correct Verification Code.\r\n");		
		//document.getElementById("testtext").focus();
		//return false;
	}
	
	var type=document.q_form.elements[11].type;
		if(document.q_form.elements["chkterm"].checked==false)
	//if(document.q_form.chkterm[0].checked==false)
		{
			msg+="Kindly accept the terms and conditions.";
			//q_form.chkterm.focus();
			//alert("yes")
		}



	if(msg.length>0)
	 {
		alert(msg);
		 return false;
	 }
	 else
	 {
		// alert("true");
		 return true;
	 }
}


function CheckKeyCode(event)
{
	if(event.which)
	{ // Netscape/Firefox/Opera
		key_code= event.which;
		if (key_code == 8) 
		{
			//alert(key_code);
			event.returnValue = true;
			return true;			
		}		
		else if (key_code < 48 || key_code > 57) 
		{
			//alert(key_code);
			event.returnValue = false;
			return false;			
		}		
		else
		{
			return true;			
		}
	}
	else if(event.keyCode)
	{ //IE
		key_code = event.keyCode
		if (key_code < 48 || key_code > 57) 
		{
			//alert(key_code);
			event.returnValue = false;
			return false;			
		}		
		else
		{
			//alert(key_code);
			return true;			
		}
	}	
}

function check_qty()
{
	if(document.getElementById("qty_a").value == "" && document.getElementById("qty_b").value == "" && document.getElementById("qty_c").value == "" && document.getElementById("qty_d").value == "" && document.getElementById("qty_e").value == "" && document.getElementById("qty_f").value == "")
	{
		alert("Please enter your quantity");
		return false;
	}
	else if(isNaN(document.getElementById("qty_a").value))
	{
		alert("Please enter Number Only");
		document.getElementById("qty_a").focus();
		return false;
	}
	else if(isNaN(document.getElementById("qty_b").value))
	{
		alert("Please enter Number Only");
		document.getElementById("qty_b").focus();
		return false;
	}
	else if(isNaN(document.getElementById("qty_c").value))
	{
		alert("Please enter Number Only");
		document.getElementById("qty_c").focus();
		return false;
	}
	else if(isNaN(document.getElementById("qty_d").value))
	{
		alert("Please enter Number Only");
		document.getElementById("qty_d").focus();
		return false;
	}
	else if(isNaN(document.getElementById("qty_e").value))
	{
		alert("Please enter Number Only");
		document.getElementById("qty_e").focus();
		return false;
	}
	else if(isNaN(document.getElementById("qty_f").value))
	{
		alert("Please enter Number Only");
		document.getElementById("qty_f").focus();
		return false;
	}
	else
	{
		callsum();		
		return true;
	}
}
function checktxn()
{
	if(document.getElementById("txnid").value=="")
	{
		alert("Please Enter The Paypal Txn Id!");
		document.getElementById("txnid").focus();
		return false;
	}
	else
	{
		return true;
	}
}

function checkSearch()
{
	if (document.frmSiteSearch.search.value=="")
	{
		alert("Please enter at least one keyword to search.");
		document.frmSiteSearch.search.focus();
		return false;
	}
	else
	{	
		return true;
	}
}
