<!--
function GetObject(strObjName)
	{
		if(document.all)
        {
            return document.all[strObjName];
        }
		else if(document.layers)
		{
			return document.layers[strObjName];
        }
        else if(!document.all && document.getElementById)
        {
            return document.getElementById(strObjName);
        }
        //alert(document.all.length)
        /*var i=0;
        for(i=0;i<=document.all.length-1;i++)
        {
			var elm = document.all[i];
			
			if(elm.name==strObjName)
			{
				//alert(elm.name)	
				return elm;
				break
			}
        }*/
	}
	//-------------------------------------------------------------------
// getElementIndex(input_object)
//   Pass an input object, returns index in form.elements[] for the object
//   Returns -1 if error
//-------------------------------------------------------------------
function getElementIndex(obj) 
	{
	var theform = obj.form;
	for (var i=0; i<theform.elements.length; i++) 
		{
		if (obj.name == theform.elements[i].name) 
			{return i;}
		}
		
	return -1;
	}

// -------------------------------------------------------------------
// tabNext(input_object)
//   Pass an form input object. Will focus() the next field in the form
//   after the passed element.
//   a) Will not focus to hidden or disabled fields
//   b) If end of form is reached, it will loop to beginning
//   c) If it loops through and reaches the original field again without
//      finding a valid field to focus, it stops
// -------------------------------------------------------------------
function tabNext(obj) 
	{
	if (navigator.platform.toUpperCase().indexOf("SUNOS") != -1) 
		{obj.blur(); return; }

	var theform = obj.form;
	var i = getElementIndex(obj);
	var j=i+1;

	if (j >= theform.elements.length) 
		{ j=0; }
	if (i == -1) 
		{ return; }
		
	while (j != i) 
		{
		if ((theform.elements[j].type!="hidden") && 
		    (theform.elements[j].name != theform.elements[i].name) && 
			(!theform.elements[j].disabled)) 
			{
			theform.elements[j].focus();
			break;
			}
		
		j++;
		
		if (j >= theform.elements.length) 
			{ j=0; }
		}
	}

function jump(obj)
	{
	if(obj.value.length == obj.maxLength)
		{ tabNext(obj); }
	}
//======= Auto Tab Ends =========================================================================
//-------------------------------------------------------------------------------------------------
//---> Alltrim an Expression
//-------------------------------------------------------------------------------------------------

// Function trim : deletes the leading and ending blank spaces
function trim(strComp)
	{
	ltrim = /^\s+/
	rtrim = /\s+$/
	strComp = strComp.replace(ltrim,'');
	strComp = strComp.replace(rtrim,'');
	return strComp;
	}

//-------------------------------------------------------------------------------------------------
//---> Required Fields
//-------------------------------------------------------------------------------------------------

// Function to require fields
function isRequired(formObject, fieldDescription) 
	{
	var tempFormValue ;
	var strError ="";	
	var iFocus =-1;

	for (var i =0; i< isRequired.arguments.length;i=i+2)
	{
	if(typeof(isRequired.arguments[i]) == 'undefined')
		{
		//alert('IsRequired-Error: Parameter no.'+(i+1)+' is not an object.')
		return false;
		}
		
	tempFormValue =trim(isRequired.arguments[i].value);
	
	if (tempFormValue.length < 15)
		{deleteLoop = tempFormValue.length}
	else
		{deleteLoop = 15}
		for (var j = 0; j < deleteLoop; j++) 
			{tempFormValue = tempFormValue.replace(/ / , "");
		}

	if (tempFormValue.length == 0)
		{	
		strError = strError+ isRequired.arguments[i+1] + "\n"
		if (iFocus ==-1)
			iFocus = i;
		}
	}

	if (strError.length != 0){	
		alert( 'Following fields are required.\n\n' + strError)		
		if(isRequired.arguments[iFocus].disabled==false)
		{
			isRequired.arguments[iFocus].focus();					
		}		
		return(false)
	}
	else
		return(true)
	}

function isRequired1(formObject, fieldDescription) 
	{
	var tempFormValue ;
	var strError ="";	
	
	for (var i =0; i< isRequired1.arguments.length;i=i+2)
	{
	if(typeof(isRequired1.arguments[i]) == 'undefined')
		{
			return false;
		}
		
	tempFormValue =trim(isRequired1.arguments[i].value);
	
	if (tempFormValue.length < 15)
		{deleteLoop = tempFormValue.length}
	else
		{deleteLoop = 15}
		for (var j = 0; j < deleteLoop; j++) 
			{tempFormValue = tempFormValue.replace(/ / , "");
		}

		if (tempFormValue.length == 0)
		{	
			strError = strError+ isRequired1.arguments[i+1] + "\n"
		}
	}

	if (strError.length != 0){	
		alert( 'Following fields are required.\n\n' + strError)
			return(false)
	}
	else
		return(true)
	}

//-------------------------------------------------------------------------------------------------
//---> Validate SElection boxes
//-------------------------------------------------------------------------------------------------

// validate the select 
function chkSel(obj,strMsg)
{
	var iFocus =-1;
	var strError="";

	for(var i=0;i<chkSel.arguments.length;i=i+2)
	{
			if(chkSel.arguments[i].value=="" || chkSel.arguments[i].value=="-1")
			{
				
				strError = strError+chkSel.arguments[i+1] + "\n"
					if (iFocus ==-1)
							iFocus = i;					

			}
	}
	if (strError.length != 0)
	{	
		alert( 'Following fields are required.\n\n' + strError);
		chkSel.arguments[iFocus].focus()
		return false;

	}
	else
		return true;

}

// Function isEmail: Validates if the value of 'IsItReal' is a valid email address
function isEmail(IsItReal)
	{
		if (IsItReal.value != "")
		{
			var valEmail = IsItReal.value;
			var reg = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
			if(reg.test(valEmail))
				return true;
			else
			{
				alert('- Invalid Email Address')
				IsItReal.focus();
				return false;
			}
		
		}
		else
		{
			alert('- Email Address Is Blank')
			IsItReal.focus();
			return false;
		}
	}

function isDate(IsItReal)
	{
		if (IsItReal.value != "")
		{
			var valDate = IsItReal.value;
			var reg = /^([0]*[1-9]|1[012])[- /.]([0]*[1-9]|[12][0-9]|3[01])[- /.]((19|20)[0-9][0-9]+)$/;
			if(reg.test(valDate))
				return true;
			else
			{
				alert('Invalid Date Format Please enter Date in MM/DD/YYYY format , e.g. "07/15/2006"')
				IsItReal.focus();
				IsItReal.select();
				IsItReal.value='';
				return false;
			}
		}
		else
		{	
			return true;
		}
	}

function datecompare(date1,date2)
	{
		//datecompare function compare date1 >= date2 then true or false
		var datefrom;
		var dateto;

		datefrom = date1.split("/");
		dateto = date2.split("/");
		if (datefrom[2] < dateto[2])
		{	
			return false;
		}
		else 
		{
			if (datefrom[2] > dateto[2])
			{
				return true;
			}
			else
			{
				// year same then compare month
				if (datefrom[0] < dateto[0])
				{	
					return false;
				}
				else
				{
					if (datefrom[0] > dateto[0])
					{
						return true;
					}
					else
					{
						// month same then compare day
						if (datefrom[1] < dateto[1])
						{	
							return false;
						}
						else
						{
							/*if (datefrom[1] > dateto[1])
							{	
								return true;
							}
							else
							{
								return false;
							}*/
							return true;
						}
					}
				}
			}
		}
	}
	
function validatekey()
	{
		if((window.event.keyCode < 46) || (window.event.keyCode >57) || (window.event.keyCode == 47))
			window.event.keyCode=null;
	}
	
function noenter()
	{
		if(window.event.keyCode == 13)
			window.event.keyCode=null;
	}
	
function checknum(obj)
	{
	//alert(obj.value)
		if (isNaN(obj.value))
		{
			alert("Please Enter Numeric Value!");
			obj.focus();
			//obj.select();
		}
	}

function isWholenum()
	{
	 
		if((window.event.keyCode < 48) || (window.event.keyCode >57))
		{
			//alert('Invalid Number!')
			window.event.keyCode=null;
		}
	}	
	
function checklen(obj,intlen)
	{
		if (obj.value.length>intlen)
		{
			alert("Total character should be less then " + intlen + "!");
			obj.focus();
		}
	}	
	
function isImage(obj)
	{
		if (obj.value.length>0)
		{
			if (obj.value.length>4)
			{
				var ext = obj.value.substring(obj.value.length-3,obj.value.length);
				if (ext == 'jpg' || ext == 'JPG' || ext == 'jpeg' || ext == 'JPEG' || ext == 'gif' || ext == 'GIF' || ext == 'png' || ext == 'PNG')
				{
					return true;
				}
				else
				{
					alert('Upload only .jpg,.gif or .png file!')
					obj.value="";
					obj.focus();
					obj.select();
					return false;
				}
			}
			else
			{
				alert('Upload only .jpg,.gif or .png file!')
				obj.value="";
				obj.focus();
				obj.select();
				return false;
			}
		}
	}
function isPhone(IsItReal,strErr)
	{
		if (IsItReal.value != "")
		{
			var valPhone = IsItReal.value;
			var reg = /^((\(\d{3,4}\)|\d{3,4}[-()])\d{4,9}([-()]\d{1,5}|\d{0}))|(\d{4,12})$/;
			if(reg.test(valPhone))
				return true;
			else
			{
				alert(strErr)
				IsItReal.focus();
				IsItReal.select();
				return false;
			}
		}
		else
		{	
			return true;
		}
	}
	
function isZip(IsItReal)
	{
		if (IsItReal.value != "")
		{
			var valZip = IsItReal.value;
			//var reg = /^\d{5}-\d{4}|\d{5}|[A-Z]\d[A-Z] \d[A-Z]\d$/;
			var reg = /^\d{5}[- ]\d{4}|\d{5,6}$/;
			if(reg.test(valZip))
				return true;
			else
			{
				alert('Invalid Zip Code!')
				IsItReal.focus();
				IsItReal.select();
				return false;
			}
		}
		else
		{	
			return true;
		}
	}
	
// For Home Page
function ShowMsg(txt)
{
	if(txt!='')
		alert(txt);
}
//Header Search
function CheckSearch()
	{

		if (document.frmheader.txtkey.value=='')
		{
			alert('Please Enter Keyword to Search!');
			document.frmheader.txtkey.focus();
			return false;
		}
		else
			return true;
			
	}
	
//Product Detail

//Shopping Cart

function checkqty(Obj)
			{
				if (Obj.value=='')
				{
					alert('Enter Quantity!')
					Obj.focus();
				}
				else if (Obj.value==0)
				{
					alert('Quantity cannot be 0!')
					Obj.value=1;
					Obj.focus();
				}
				else
				{
					checknum(Obj);
				}
			}
			function CheckCoupon()
			{
				if (document.form1.txtcoupon.value=='')
				{
					alert('Enter Coupon Code!');
					return false;
				}
				else
					return true;
			}
			function confirmdelete()
			{
			
			return (confirm('Are you sure you want to delete this Product ?'))?true:false;
			}
//Checkoutb.aspx
function reset()
		{
			document.form1.reset();
		}
	function setval()
		{
			if(document.form1.drpbillState.value=='0')
			{
				document.form1.hdnbillstate.value=document.form1.txtbillother.value;
			}
			else
			{
				document.form1.hdnbillstate.value=document.form1.drpbillState.value;
			}
			
			if(document.form1.drpshipState.value=='0')
			{
				document.form1.hdnshipstate.value=document.form1.txtshipother.value;
			}
			else
			{
				document.form1.hdnshipstate.value=document.form1.drpshipState.value;
			}
		}
		function setvalcountry()
		{
			if(document.form1.drpshipState.value!='0')
			{
				document.form1.hdnCountry.value=document.form1.drpbillCountry.value;
			}
		}
		function clearval(type)
		{
			if (type=='bill')
			{
				if(document.form1.drpbillState.value>0)
				{
					document.form1.txtbillother.value="";
					document.form1.txtbillother.disabled=true;
					document.form1.chkbillother.checked=false;
				}
				else if(document.form1.drpbillState.value==0)
				{
					document.form1.txtbillother.value="";
					document.form1.txtbillother.disabled=false;
					document.form1.chkbillother.checked=true;
				}
			}
			if (type=='ship')
			{
				if(document.form1.drpshipState.value>0)
				{
					document.form1.txtshipother.value="";
					document.form1.txtshipother.disabled=true;
					document.form1.chkshipother.checked=false;
				}
				else if(document.form1.drpshipState.value==0)
				{
					document.form1.txtshipother.value="";
					document.form1.txtshipother.disabled=false;
					document.form1.chkshipother.checked=true;
				}
			}
		}
		function setstate1(Obj)
		{
			if (Obj.checked)
			{
				GetObject('drpbillState').value = "0"
				GetObject('txtbillother').disabled=false
			}
			else
			{
				GetObject('drpbillState').value = "";
				GetObject('txtbillother').value="";
			}
		}
		function setstate2(Obj)
		{
			if (Obj.checked)
			{
				document.form1.drpshipState.value = "0"
				document.form1.txtshipother.disabled=false
			}
			else
			{
				document.form1.drpshipState.value = "";
				document.form1.txtshipother.value="";
			}
		}
		function validate()
		{
			setval();
			//isEmail(document.form1.txtbillemail);
			
			if (isRequired(document.form1.txtbillemail,'-- Billing Email',document.form1.txtbillfname,'-- Billing First Name',document.form1.txtbilllname,'-- Billing Last Name',document.form1.txtbilladd1,'-- Billing Address',document.form1.txtbillcity,'-- Billing City',document.form1.hdnbillstate,'-- Billing State',document.form1.drpbillCountry,'-- Billing Country',document.form1.txtbillzip,'-- Billing Zip',document.form1.txtbillphone,'-- Billing Phone',document.form1.txtshipemail,'-- Shipping Email',document.form1.txtshipfname,'-- Shipping First Name',document.form1.txtshiplname,'-- Shipping Last Name',document.form1.txtshipadd1,'-- Shipping Address',document.form1.txtshipcity,'-- Shipping City',document.form1.hdnshipstate,'-- Shipping State',document.form1.drpshipCountry,'-- Shipping Country',document.form1.txtshipzip,'-- Shipping Zip',document.form1.txtshipphone,'-- Shipping Phone'))
			{				
				if(document.form1.txtbillemail.value.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/))
				{					
					if(document.form1.txtshipemail.value.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/))
					{						
						if(document.form1.drpbillCountry.value==226)
						{							
							if(isZip(document.form1.txtbillzip))
							{
								return validatephone();
							}
							else
							{
								return false;
							}
						}
						else
						{							
							return validatephone();
						}
					}
					else
					{
						alert('--Invalid Shipping E-mail Address');	
						if(document.form1.txtshipemail.disabled==false)
							document.form1.txtshipemail.focus(); 
						return false;
					}
				}
				else
				{	
					alert('--Invalid Billing E-mail Address');	
					if(document.form1.txtbillemail.disabled==false)
							document.form1.txtbillemail.focus(); 			
					return false;
				}				
			}
			else
			{
				return false;
			}
		}
		function setvalues()
		{
						document.form1.txtbillemail.disabled = false 
						document.form1.txtbillfname.disabled = false
						document.form1.txtbilllname.disabled = false
						document.form1.txtbilladd1.disabled = false
						document.form1.txtbilladd2.disabled = false
						document.form1.txtbillcity.disabled = false
						document.form1.drpbillState.disabled = false
						document.form1.txtbillother.disabled = false
						document.form1.drpbillCountry.disabled = false
						document.form1.txtbillzip.disabled = false
						document.form1.txtbillphone.disabled = false
						document.form1.chkbillother.disabled = false
						document.form1.hdnState.value = document.form1.drpbillState.value
						document.form1.hdnCountry.value = document.form1.drpbillCountry.value
		}
		function validatephone()
		{
							if(isPhone(document.form1.txtbillphone,'Invalid Billing Phone!'))
							{
								if(document.form1.drpshipCountry.value==226)
								{									
									if(isZip(document.form1.txtshipzip))
									{																
										setvalues();								
										return true;								
									}
									else
									{
										return false;
									}
								}
								else
								{									
									setvalues();
									return true;
								}
							}
							else
							{
								return false;
							}
		}
		function sameshipping(Obj)
		{
			if (Obj.checked)
			{
				
				document.form1.txtshipemail.value=document.form1.txtbillemail.value;
				document.form1.txtshipfname.value=document.form1.txtbillfname.value;
				document.form1.txtshiplname.value=document.form1.txtbilllname.value;
				document.form1.txtshipadd1.value=document.form1.txtbilladd1.value;
				document.form1.txtshipadd2.value=document.form1.txtbilladd2.value;
				document.form1.txtshipcity.value=document.form1.txtbillcity.value;
				document.form1.drpshipState.value=document.form1.drpbillState.value;
				document.form1.txtshipother.value=document.form1.txtbillother.value;
				document.form1.drpshipCountry.value=document.form1.drpbillCountry.value;
				document.form1.txtshipzip.value=document.form1.txtbillzip.value;
				document.form1.txtshipphone.value=document.form1.txtbillphone.value;
				document.form1.chkshipother.checked = document.form1.chkbillother.checked;
				
				document.form1.txtshipemail.disabled = true 
				document.form1.txtshipfname.disabled = true
				document.form1.txtshiplname.disabled = true
				document.form1.txtshipadd1.disabled = true
				document.form1.txtshipadd2.disabled = true
				document.form1.txtshipcity.disabled = true
				document.form1.drpshipState.disabled = true
				document.form1.txtshipother.disabled = true
				document.form1.drpshipCountry.disabled = true
				document.form1.txtshipzip.disabled = true
				document.form1.txtshipphone.disabled = true
				document.form1.chkshipother.disabled = true
				
				document.form1.txtbillemail.disabled = true 
				document.form1.txtbillfname.disabled = true
				document.form1.txtbilllname.disabled = true
				document.form1.txtbilladd1.disabled = true
				document.form1.txtbilladd2.disabled = true
				document.form1.txtbillcity.disabled = true
				document.form1.drpbillState.disabled = true
				document.form1.txtbillother.disabled = true
				document.form1.drpbillCountry.disabled = true
				document.form1.txtbillzip.disabled = true
				document.form1.txtbillphone.disabled = true
				document.form1.chkbillother.disabled = true							
			}
			else
			{
				document.form1.txtshipemail.value="";
				document.form1.txtshipfname.value="";
				document.form1.txtshiplname.value="";
				document.form1.txtshipadd1.value="";
				document.form1.txtshipadd2.value="";
				document.form1.txtshipcity.value="";
				document.form1.txtshipother.value="";
				document.form1.drpshipState.value="";
				document.form1.drpshipCountry.value="";
				document.form1.txtshipzip.value="";
				document.form1.txtshipphone.value="";
				document.form1.chkshipother.checked=false;
				
										
				document.form1.txtshipemail.disabled = false 
				document.form1.txtshipfname.disabled = false
				document.form1.txtshiplname.disabled = false
				document.form1.txtshipadd1.disabled = false
				document.form1.txtshipadd2.disabled = false
				document.form1.txtshipcity.disabled = false
				document.form1.drpshipState.disabled = false
				document.form1.txtshipother.disabled = false
				document.form1.drpshipCountry.disabled = false
				document.form1.txtshipzip.disabled = false
				document.form1.txtshipphone.disabled = false
				document.form1.chkshipother.disabled = false
				
				document.form1.txtbillemail.disabled = false 
				document.form1.txtbillfname.disabled = false
				document.form1.txtbilllname.disabled = false
				document.form1.txtbilladd1.disabled = false
				document.form1.txtbilladd2.disabled = false
				document.form1.txtbillcity.disabled = false
				document.form1.drpbillState.disabled = false
				document.form1.txtbillother.disabled = false
				document.form1.drpbillCountry.disabled = false
				document.form1.txtbillzip.disabled = false
				document.form1.txtbillphone.disabled = false
				document.form1.chkbillother.disabled = false	
			}
		}
//Footer

function CouponVal()
	{
	var obj=document.getElementById("couponemail");	 	
	if(obj.value=='')
	{
		alert('Please Enter Email');
		obj.focus();
		return false;
	}	
	else if(!obj.value.match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/))
	{
		alert('Please Enter valid Email');
		obj.focus();
		return false;
		
	}	
	return true;
}

function clearfield(obj)
{
	if (obj.value=="Enter Email Address")
	{
		obj.value="";
	}
}

function setfield(obj)
{
	if (obj.value=="")
	{
		obj.value="Enter Email Address";
	}
}
	function bookmark()
	{
		title = "GiveFavors.com"; 
		// Blogger - Replace with <$BlogItemTitle$> 
		// MovableType - Replace with <$MTEntryTitle$>
		url = "http://www.givefavors.com";
		// Blogger - Replace with <$BlogItemPermalinkURL$> 
		// MovableType - Replace with <$MTEntryPermalink$>
		// WordPress - <?php bloginfo('url'); ?>
		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;
		}
	//window.external.AddFavorite('http://www.givefavors.com','GiveFavors.com')
	//return false;
	}
//Checkoutc
<!--
function temp()
{
//alert('in');
}
function mod10( cardNumber ) 
{ // LUHN Formula for validation of credit card numbers.
	var ar = new Array( cardNumber.length );
	var i = 0,sum = 0;


    for( i = 0; i < cardNumber.length; ++i ) {
    	ar[i] = parseInt(cardNumber.charAt(i));
    }
    for( i = ar.length -2; i >= 0; i-=2 ) { // you have to start from the right, and work back.
    	ar[i] *= 2;							 // every second digit starting with the right most (check digit)
    	if( ar[i] > 9 ) ar[i]-=9;			 // will be doubled, and summed with the skipped digits.
    }										 // if the double digit is > 9, ADD those individual digits together 


    for( i = 0; i < ar.length; ++i ) {
        sum += ar[i];						 // if the sum is divisible by 10 mod10 succeeds
    }
    return (((sum%10)==0)?true:false);	 	
}
function expired( month, year ) {
        	var now = new Date();							// this function is designed to be Y2K compliant.
        	var expiresIn = new Date(year,month,0,0,0);		// create an expired on date object with valid thru expiration date
        	expiresIn.setMonth(expiresIn.getMonth()+1);		// adjust the month, to first day, hour, minute & second of expired month
        	if( now.getTime() < expiresIn.getTime() ) return false;
        	return true;									// then we get the miliseconds, and do a long integer comparison
}
function validateCard() 
{ 
          cardNumber=document.form1.txtCardNo.value;
          cardType=document.form1.cmbCard.value;
          cardMonth=document.form1.cmbMonth.value;
          cardYear=document.form1.cmbYear.value; 
			if( cardType.length == 0 ) {						//most of these checks are self explanitory
        		alert("Please select card type.");
        		return false;				
        	}  
        	  
        	if( cardNumber.length == 0 ) {						//most of these checks are self explanitory
        		alert("Please enter a valid card number.");
        		return false;				
        	}
        	
        	
        	for( var i = 0; i < cardNumber.length; ++i ) {		// make sure the number is all digits.. (by design)
        		var c = cardNumber.charAt(i);


            		if( c < '0' || c > '9' ) {
            			alert("Please enter a valid card number. Use only digits. do not use spaces or hyphens.");
            			return false;
            		}
            	}
            	var length = cardNumber.length;			//perform card specific length and prefix tests
			if( expired( cardMonth, cardYear ) ) {							// check if entered date is already expired.
				alert("Sorry! The expiration date you have entered would make this card invalid.");
				return false;
			}
			if(document.form1.txtCode.value.length == 0 ) {						//most of these checks are self explanitory
        		alert("Please enter Card Verification Code.");
        		return false;				
			}  
                	switch( cardType ) {
                		case 'American Express':


                    			if( length != 15 ) {
                    				alert("Please enter a valid American Express Card number.");
                    				return false;
                    			}
                    			var prefix = parseInt( cardNumber.substring(0,2));


                        			if( prefix != 34 && prefix != 37 ) {
                        				alert("Please enter a valid American Express Card number.");
                        				return false;
                        			}
                        			break;
                        		case 'Discover':


                            			if( length != 16 ) {
                            				alert("Please enter a valid Discover Card number.");
                            				return false;
                            			}
                            			var prefix = parseInt( cardNumber.substring(0,4));


                                			if( prefix != 6011 ) {
                                				alert("Please enter a valid Discover Card number.");
                                				return false;
                                			}
                                			break;
                                		case 'Master Card':


                                    			if( length != 16 ) {
                                    				alert("Please enter a valid MasterCard number.");
                                    				return false;
                                    			}
                                    			var prefix = parseInt( cardNumber.substring(0,2));


                                        			if( prefix < 51 || prefix > 55) {
                                        				alert("Please enter a valid MasterCard Card number.");
                                        				return false;
                                        			}
                                        			break;
                                        		case 'Visa':


                                            			if( length != 16 && length != 13 ) {
                                            				alert("Please enter a valid Visa Card number.");
                                            				return false;
                                            			}
                                            			var prefix = parseInt( cardNumber.substring(0,1));


                                                			if( prefix != 4 ) {
                                                				alert("Please enter a valid Visa Card number.");
                                                				return false;
                                                			}
                                                			break;
                                                	}
                                                	if( !mod10( cardNumber ) ) { 		// run the check digit algorithm
                                                		alert("Sorry! this is not a valid credit card number.");
                                                		return false;
                                                	}
                                                	
                                                	
													if(isNaN(document.form1.txtCode.value)) {						//most of these checks are self explanitory
        												alert("Please enter numeric Card Verification Code.");
        												return false;				
        											}     
                                                	return true; // at this point card has not been proven to be invalid
                                            }
            
			var isclicked = 0;
			function numbersonly(myfield, e, dec)
			{
			var key;
			var keychar;
		   
			if (window.event)
			key = window.event.keyCode;
			else if (e)
			key = e.which;
			else
			return true;
			keychar = String.fromCharCode(key);
		   
			// control keys
			if ((key==null) || (key==0) || (key==8) ||
			(key==9) || (key==13) || (key==27) )
			return true;
		   
			// numbers
			else if ((("0123456789").indexOf(keychar) > -1))
			return true;
		   
			// decimal point jump
			else if (dec && (keychar == "."))
			{
			myfield.form.elements[dec].focus();
			return false;
			}
			else
			return false;
			}
//Advanced.aspx
function checkPriceF()
			{
				if(document.form1.txtPriceF.value != "" && document.form1.txtPriceT.value == "")
				{
				alert('Enter Price To!')    
				return false;       
				}  
				else if(document.form1.txtPriceT.value != "" && document.form1.txtPriceF.value == "")
				{
				alert('Enter Price From!')           
				return false;
				} 
				else if(document.form1.txtPriceT.value != "" && document.form1.txtPriceF.value != "")
				{
					if(!isNaN(document.form1.txtPriceF.value) && !isNaN(document.form1.txtPriceT.value))
					{
						if(parseFloat(document.form1.txtPriceF.value) > parseFloat(document.form1.txtPriceT.value))
						{
							alert('From Price should be less then To Price!')
							return false;
						}
						else
							return true;
					}
					else
					{
						alert('Enter Proper price value!')
						return false;
					}
				}
				else
				return true;  
			}
			function validateSearch()
			{
				if (document.form1.txtPriceF.value=="0")
				{
					document.form1.txtPriceF.value = 1;
					return true;
				}
				/*if (document.form1.txtfdate.value!='' && document.form1.txttdate.value=='')
				{
					alert("Please select To date!")
					return false;
				}
				else if (document.form1.txttdate.value!='' && document.form1.txtfdate.value=='')
				{
					alert("Please select From date!")
					return false;
				}*/
				
				else if (!isNaN(document.form1.txtPriceF.value) && !isNaN(document.form1.txtPriceT.value))
				{
					if (parseFloat(document.form1.txtPriceF.value)>=parseFloat(document.form1.txtPriceT.value))
					{
						alert('From Price should be less then To Price!')
						document.form1.txtPriceF.focus();
						return false;
					}
					else
						return true;
				}
				else
					return true;
				
			}
			
			function numbersonly(myfield, e, dec)
			{
				var key;
				var keychar;
			
				if (window.event)
				   key = window.event.keyCode;
				else if (e)
				   key = e.which;
				else
				   return true;
				keychar = String.fromCharCode(key);
			
				// control keys
				if ((key==null) || (key==0) || (key==8) ||
					(key==9) || (key==13) || (key==27) )
				   return true;
			
				// numbers
				else if ((("0123456789").indexOf(keychar) > -1))
				   return true;
			
			// decimal point jump
				else if (dec && (keychar == "."))
				   {
				   myfield.form.elements[dec].focus();
				   return false;
				   }
				else
				   return false;
				}
			function dropdown()
			{
				if(document.form1.txtKeyword.value != "")
				{
					return true;
				}
				//else if(document.getElementById('drpCat').value == 0)
				//{
			//		alert("Select Any Category.");
			//		return false;
			//	}
				else 
					return true;
			}
//-->