//v1.7
// Flash Player Version Detection
// Detect Client Browser type
// Copyright 2005-2007 Adobe Systems Incorporated.  All rights reserved.
var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;

function ControlVersion()
{
	var version;
	var axo;
	var e;

	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry

	try {
		// version will be set for 7.X or greater players
		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
		version = axo.GetVariable("$version");
	} catch (e) {
	}

	if (!version)
	{
		try {
			// version will be set for 6.X players only
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
			
			// installed player is some revision of 6.0
			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
			// so we have to be careful. 
			
			// default to the first public version
			version = "WIN 6,0,21,0";

			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
			axo.AllowScriptAccess = "always";

			// safe to call for 6.0r47 or greater
			version = axo.GetVariable("$version");

		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 4.X or 5.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = axo.GetVariable("$version");
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 3.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
			version = "WIN 3,0,18,0";
		} catch (e) {
		}
	}

	if (!version)
	{
		try {
			// version will be set for 2.X player
			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
			version = "WIN 2,0,0,11";
		} catch (e) {
			version = -1;
		}
	}
	
	return version;
}

// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(){
	// NS/Opera version >= 3 check for Flash plugin in plugin array
	var flashVer = -1;
	
	if (navigator.plugins != null && navigator.plugins.length > 0) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
			var descArray = flashDescription.split(" ");
			var tempArrayMajor = descArray[2].split(".");			
			var versionMajor = tempArrayMajor[0];
			var versionMinor = tempArrayMajor[1];
			var versionRevision = descArray[3];
			if (versionRevision == "") {
				versionRevision = descArray[4];
			}
			if (versionRevision[0] == "d") {
				versionRevision = versionRevision.substring(1);
			} else if (versionRevision[0] == "r") {
				versionRevision = versionRevision.substring(1);
				if (versionRevision.indexOf("d") > 0) {
					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
				}
			}
			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
		}
	}
	// MSN/WebTV 2.6 supports Flash 4
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
	// WebTV 2.5 supports Flash 3
	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
	// older WebTV supports Flash 2
	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
	else if ( isIE && isWin && !isOpera ) {
		flashVer = ControlVersion();
	}	
	return flashVer;
}

// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
	versionStr = GetSwfVer();
	if (versionStr == -1 ) {
		return false;
	} else if (versionStr != 0) {
		if(isIE && isWin && !isOpera) {
			// Given "WIN 2,0,0,11"
			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
			tempString        = tempArray[1];			// "2,0,0,11"
			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
		} else {
			versionArray      = versionStr.split(".");
		}
		var versionMajor      = versionArray[0];
		var versionMinor      = versionArray[1];
		var versionRevision   = versionArray[2];

        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
		if (versionMajor > parseFloat(reqMajorVer)) {
			return true;
		} else if (versionMajor == parseFloat(reqMajorVer)) {
			if (versionMinor > parseFloat(reqMinorVer))
				return true;
			else if (versionMinor == parseFloat(reqMinorVer)) {
				if (versionRevision >= parseFloat(reqRevision))
					return true;
			}
		}
		return false;
	}
}

function AC_AddExtension(src, ext)
{
  if (src.indexOf('?') != -1)
    return src.replace(/\?/, ext+'?'); 
  else
    return src + ext;
}

function AC_Generateobj(objAttrs, params, embedAttrs) 
{ 
  var str = '';
  if (isIE && isWin && !isOpera)
  {
    str += '<object ';
    for (var i in objAttrs)
    {
      str += i + '="' + objAttrs[i] + '" ';
    }
    str += '>';
    for (var i in params)
    {
      str += '<param name="' + i + '" value="' + params[i] + '" /> ';
    }
    str += '</object>';
  }
  else
  {
    str += '<embed ';
    for (var i in embedAttrs)
    {
      str += i + '="' + embedAttrs[i] + '" ';
    }
    str += '> </embed>';
  }

  document.write(str);
}

function AC_FL_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
     , "application/x-shockwave-flash"
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_SW_RunContent(){
  var ret = 
    AC_GetArgs
    (  arguments, ".dcr", "src", "clsid:166B1BCA-3F9C-11CF-8075-444553540000"
     , null
    );
  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
}

function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
  var ret = new Object();
  ret.embedAttrs = new Object();
  ret.params = new Object();
  ret.objAttrs = new Object();
  for (var i=0; i < args.length; i=i+2){
    var currArg = args[i].toLowerCase();    

    switch (currArg){	
      case "classid":
        break;
      case "pluginspage":
        ret.embedAttrs[args[i]] = args[i+1];
        break;
      case "src":
      case "movie":	
        args[i+1] = AC_AddExtension(args[i+1], ext);
        ret.embedAttrs["src"] = args[i+1];
        ret.params[srcParamName] = args[i+1];
        break;
      case "onafterupdate":
      case "onbeforeupdate":
      case "onblur":
      case "oncellchange":
      case "onclick":
      case "ondblClick":
      case "ondrag":
      case "ondragend":
      case "ondragenter":
      case "ondragleave":
      case "ondragover":
      case "ondrop":
      case "onfinish":
      case "onfocus":
      case "onhelp":
      case "onmousedown":
      case "onmouseup":
      case "onmouseover":
      case "onmousemove":
      case "onmouseout":
      case "onkeypress":
      case "onkeydown":
      case "onkeyup":
      case "onload":
      case "onlosecapture":
      case "onpropertychange":
      case "onreadystatechange":
      case "onrowsdelete":
      case "onrowenter":
      case "onrowexit":
      case "onrowsinserted":
      case "onstart":
      case "onscroll":
      case "onbeforeeditfocus":
      case "onactivate":
      case "onbeforedeactivate":
      case "ondeactivate":
      case "type":
      case "codebase":
      case "id":
        ret.objAttrs[args[i]] = args[i+1];
        break;
      case "width":
      case "height":
      case "align":
      case "vspace": 
      case "hspace":
      case "class":
      case "title":
      case "accesskey":
      case "name":
      case "tabindex":
        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
        break;
      default:
        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
    }
  }
  ret.objAttrs["classid"] = classid;
  if (mimeType) ret.embedAttrs["type"] = mimeType;
  return ret;
}

//===================ADDED by Imran pat 1 

// JavaScript Document
function OpenWin(myurl){
window.open(myurl,'','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=480,height=300,top=400,left=520');
}

function OpenWin(myurl){
window.open(myurl,'','scrollbars=yes,resizable=yes,width=590,height=500,top=400,left=520');
}

function copyvalue()
{


	var billCountry=document.myform.billCountry.value
	var billFirstName=document.myform.billFirstName.value
	var billLastName=document.myform.billLastName.value
	var billAddress1=document.myform.billAddress1.value
	var billAddress2=document.myform.billAddress2.value
	
	var bilCity=document.myform.bilCity.value
	var billState=document.myform.billState.value
	var billZip=document.myform.billZip.value
	
	if(document.myform.same.checked == true)

	{
		document.myform.shipFirstName.value=billFirstName
		document.myform.shipLastName.value=billLastName
		document.myform.shipAddress1.value=billAddress1
		document.myform.shipAddress2.value=billAddress2
		document.myform.shipCity.value=bilCity
		document.myform.shipState.value=billState
		document.myform.shipZip.value=billZip
		document.myform.shipCountry.value=billCountry
	}
	else{

		document.myform.shipFirstName.value=""
		document.myform.shipLastName.value=""
		document.myform.shipAddress1.value=""
		document.myform.shipAddress2.value=""
		document.myform.shipCity.value=""
		document.myform.shipState.value=""
		document.myform.shipZip.value=""
		document.myform.shipCountry.value=""

	
	}

}



function isValidNumber(val) {
	if (!/^\d+$/.test(val)) {
		return false;
	}
	return true;
}

function isValidFloatNumber(val) {
	if (!/^((\d+(\.\d*)?)|((\d*\.)?\d+))$/.test(val)) {
		return false;
	}
	return true;
}
	


function validateOfferForm()
{


	var companyName=document.myform.companyName
	var billFirstName=document.myform.billFirstName
	var billLastName=document.myform.billLastName
	var billAddress1=document.myform.billAddress1
	
	var bilCity=document.myform.bilCity
	var billState=document.myform.billState
	var billZip=document.myform.billZip
	var billPhone=document.myform.billPhone
	var billEmail=document.myform.billEmail
	
	var shipFirstName=document.myform.shipFirstName
	var shipLastName=document.myform.shipLastName
	var shipAddress1=document.myform.shipAddress1
	
	var shipCity=document.myform.shipCity
	var shipState=document.myform.shipState
	var shipZip=document.myform.shipZip
	

	var offerPrice=document.myform.offerPrice
	var qty=document.myform.qty
	
	
	var shipZip=document.myform.shipZip
     var code=document.myform.code

	/*
	if ((companyName.value==null)||(companyName.value=="")){
		alert("Please enter your company name")
		companyName.focus()
		return false
	}*/

	if ((billFirstName.value==null)||(billFirstName.value=="")){
		alert("Please enter your bill first name")
		billFirstName.focus()
		return false
	}

	if ((billLastName.value==null)||(billLastName.value=="")){
		alert("Please enter your bill last name")
		billLastName.focus()
		return false
	}

	if ((billAddress1.value==null)||(billAddress1.value=="")){
		alert("Please enter your bill address1")
		billAddress1.focus()
		return false
	}


	
	if ((bilCity.value==null)||(bilCity.value=="")){
		alert("Please enter bill city name")
		bilCity.focus()
		return false
	}

	if ((billState.value==null)||(billState.value=="")){
		alert("Please enter bill state")
		billState.focus()
		return false
	}
	
	if ((billZip.value==null)||(billZip.value=="")){
		alert("Please enter bill zip")
		billZip.focus()
		return false
	}

	if (validatezipcode(billZip.value)==false){
			billZip.focus()
			return false
	}



	if ((billPhone.value==null)||(billPhone.value=="")){
		alert("Please enter bill Phone")
		billPhone.focus()
		return false
	}


	if (phonevalidate(billPhone.value)==false){
			billPhone.focus()
			return false
		}


	if ((billEmail.value==null)||(billEmail.value=="")){
		alert("Please enter email")
		billEmail.focus()
		return false
	}
	
	if (echeck(billEmail.value)==false){
		billEmail.focus()
		return false
	}


	if ((shipFirstName.value==null)||(shipFirstName.value=="")){
		alert("Please enter your bill ship name")
		shipFirstName.focus()
		return false
	}

	if ((shipLastName.value==null)||(shipLastName.value=="")){
		alert("Please enter your bill ship name")
		shipLastName.focus()
		return false
	}

	if ((shipAddress1.value==null)||(shipAddress1.value=="")){
		alert("Please enter your ship address1")
		shipAddress1.focus()
		return false
	}


	
	if ((shipCity.value==null)||(shipCity.value=="")){
		alert("Please enter ship city ")
		shipCity.focus()
		return false
	}

	if ((shipState.value==null)||(shipState.value=="")){
		alert("Please enter ship state")
		shipState.focus()
		return false
	}
	
	if ((shipZip.value==null)||(shipZip.value=="")){
		alert("Please enter ship zip")
		shipZip.focus()
		return false
	}
	
	
	

	if((offerPrice.value==null)||(offerPrice.value=="") || (offerPrice.value== '0')){
		alert('Please enter a offer price!');
		offerPrice.focus();
		return false;
	}else if(!isValidFloatNumber(offerPrice.value)){
		alert('Please enter a valid offer price!');
		offerPrice.focus();
		return false;
	}

	if(isNaN(qty.value) || (qty.value== '0'))
	{
		alert("Please enter Qty value!");
	    qty.focus()
		return false;
	}else if(!isValidNumber(qty.value)){
		alert('Please enter a valid qty value!');
		qty.focus();
		return false;
	}



	


/*	if((parseFloat(offerPrice.valuvalue) == parseInt(offerPrice.valuvalue)) && !isNaN(parseInt(offerPrice.valu))){
	
	alert("hello");
	}
	else
      {
		alert("Please enter a valid price")
		offerPrice.focus()
		return false
	}*/
	
	
	
	
if ((code.value==null)||(code.value=="")){
		alert("Please type the security code?")
		code.focus()
		return false
	}

	return true
}


function validateRating()
{

	var subject=document.myform.subject
	var nick=document.myform.nick
	var comments=document.myform.comments
	var code=document.myform.code
	
	
	
	if ((subject.value==null)||(subject.value=="")){
		alert("Please enter  subject")
		subject.focus()
		return false
	}


	if ((nick.value==null)||(nick.value=="")){
		alert("Please enter your name")
		nick.focus()
		return false
	}

	if ((comments.value==null)||(comments.value=="")){
		alert("Please enter comments")
		comments.focus()
		return false
	}
	if ((code.value==null)||(code.value=="")){
		alert("Please type the security code?")
		code.focus()
		return false
	}
	

return true

}



function validatezipcode(zipcode)
{

	var no="0123456789"
	var temp

	if(	zipcode.length<5)
	{
		alert("Please enter valid zip code");
		return false;														
	}

	for (var i=0;i<zipcode.length;i++)
	{
	   temp=zipcode.substring(i,i+1)
		if (no.indexOf(temp)==-1)
		{
			alert("Please enter valid zip code");
			return false;
		}
	}
	return true;

	
}

function phonevalidate(phonenumber)
{
	
	
	var vph="()0123456789-"
	var no="0123456789"
	var temp


	for (var i=0;i<phonenumber.length;i++)
	{
	   temp=phonenumber.substring(i,i+1)
		if (vph.indexOf(temp)==-1)
		{
			alert("Please enter phone no, like 999-999-9999 or (999)-999-9999");
			return false;
		}
	}

	

	if(	phonenumber.length<12)
	{
		alert("Please enter phone no, like 999-999-9999 or (999)-999-9999");
		return false;														
	}

	
	

//	if(phonenumber.substring(0,1)=="("
	
	
	/*
	if(phonenumber.substring(0,1)=="-" || phonenumber.substring(1,2)=="-" || phonenumber.substring(2,3)=="-" || phonenumber.substring(4,5)=="-" || phonenumber.substring(5,6)=="-"  || phonenumber.substring(6,7)=="-" || phonenumber.substring(8,9)=="-" || phonenumber.substring(9,10)=="-" || phonenumber.substring(10,11)=="-" || phonenumber.substring(11,12)=="-" || phonenumber.substring(12,12)=="-")
	{
		alert("Please enter phone number, like 999-999-9999");
		return false;
	}
	*/
	// To check either phone has all "0".
	if(phonenumber.substring(0,1)==0 && phonenumber.substring(1,2)==0 && phonenumber.substring(2,3)==0  && phonenumber.substring(4,5)==0 && phonenumber.substring(5,6)==0  && phonenumber.substring(6,7)==0  && phonenumber.substring(8,9)==0 && phonenumber.substring(9,10)==0 && phonenumber.substring(10,11)==0 && phonenumber.substring(11,12)==0)
	{
		alert("Please enter valid phone no, not all zero's");
		return false;
	}
	//To check,if 4th and 8th positions have "-".
	if (phonenumber.substring(0,1)=="(")
	{
		if(phonenumber.substring(0,1)!="("|| phonenumber.substring(4,5)!=")" || phonenumber.substring(8,9)!="-")
		{
			alert("Please enter phone no, like 999-999-9999 or (999)-999-9999");
			return false;
		}
	
		if(	phonenumber.length!=13)
		{
			alert("Please enter phone no, like 999-999-9999 or (999)-999-9999");
			return false;														
		}

	
	}
	else
	{
		if(phonenumber.substring(3,4)!="-"|| phonenumber.substring(7,8)!="-")
		{
			alert("Please enter phone no, like 999-999-9999 or (999)-999-9999");
			return false;
		}
		if(	phonenumber.length!=12)
		{
			alert("Please enter phone no, like 999-999-9999 or (999)-999-9999");
			return false;														
		}

	}
	

	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){
		   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){
		    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){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}

//login page validate*************************************************

function ValidateLoginForm(){
	var emailID=document.login.loginEmail
	var pass=document.login.loginPassword
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.focus()
		return false
	}
	if ((pass.value==null)||(pass.value=="")){
		alert("Please Enter Password")
		pass.focus()
		return false
	}
	
	
	
	return true
 }

//*****************************************************subscribe validate*********************************

function validateSubscribe(){
	var emailID=document.subs.subscribe
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.focus()
		return false
	}
	return true
 }

//*************************************************************************
//validate request form

function validateRequestForm()
{

	var name=document.myform.name
	var city=document.myform.city
	var state=document.myform.state
	var zip=document.myform.zip
	var email=document.myform.email
	var reemail=document.myform.reemail
	var code=document.myform.code
	

	
	
	
	if ((name.value==null)||(name.value=="")){
		alert("Please enter your name")
		name.focus()
		return false
	}
	
	if ((city.value==null)||(city.value=="")){
		alert("Please enter city name")
		city.focus()
		return false
	}

	if ((state.value==null)||(state.value=="")){
		alert("Please enter state name")
		state.focus()
		return false
	}

	if ((zip.value==null)||(zip.value=="")){
		alert("Please enter zip code")
		zip.focus()
		return false
	}

	if ((email.value==null)||(email.value=="")){
		alert("Please enter email")
		email.focus()
		return false
	}
	
	if (echeck(email.value)==false){
		email.focus()
		return false
	}
	
	if ((reemail.value==null)||(reemail.value=="")){
		alert("Please enter email")
		reemail.focus()
		return false
	}
	
	if (echeck(reemail.value)==false){
		reemail.focus()
		return false
	}

	if(email.value!=reemail.value)
	{
		alert("Email and re-type email does not match")
		email.focus()
		return false
	}
	
	if ((code.value==null)||(code.value=="")){
		alert("Please type the security code?")
		code.focus()
		return false
	}
	
	
	return true

}

//************************************************************************************************

function validateRequestForm2()
{

	var name=document.myform.name
	var address=document.myform.address
	var phone=document.myform.phone
	var hearus=document.myform.hearus
	
	
	var city=document.myform.city
	var state=document.myform.state
	var zip=document.myform.zip
	var email=document.myform.email
	var reemail=document.myform.reemail
	var code=document.myform.code
	
	
	
	
	if ((name.value==null)||(name.value=="")){
		alert("Please enter your name")
		name.focus()
		return false
	}
	
	if ((address.value==null)||(address.value=="")){
		alert("Please enter address")
		address.focus()
		return false
	}

	if ((city.value==null)||(city.value=="")){
		alert("Please enter city name")
		city.focus()
		return false
	}

	if ((state.value==null)||(state.value=="")){
		alert("Please enter state name")
		state.focus()
		return false
	}

	if ((zip.value==null)||(zip.value=="")){
		alert("Please enter zip code")
		zip.focus()
		return false
	}

	if (validatezipcode(zip.value)==false){
			zip.focus()
			return false
		}


	if ((phone.value==null)||(phone.value=="")){
		alert("Please enter phone code")
		phone.focus()

		return false
	}

	if (phonevalidate(phone.value)==false){
			phone.focus()
			return false
		}


	if ((email.value==null)||(email.value=="")){
		alert("Please enter email")
		email.focus()
		return false
	}
	
	if (echeck(email.value)==false){
		email.focus()
		return false
	}
	
	if ((reemail.value==null)||(reemail.value=="")){
		alert("Please enter email")
		reemail.focus()
		return false
	}
	
	if (echeck(reemail.value)==false){
		reemail.focus()
		return false
	}

	if(email.value!=reemail.value)
	{
		alert("Email and re-type email does not match")
		email.focus()
		return false
	}

	if ((hearus.value==null)||(hearus.value=="")){
		alert("Please enter Where did you hear about us?")
		hearus.focus()
		return false
	}
	
	if ((code.value==null)||(code.value=="")){
		alert("Please type the security code?")
		code.focus()
		return false
	}
	
	return true

}
//******************************************************************************************************

function validateoffer()
{
	var billCountry=document.offer.billCountry
	var companyName=document.offer.companyName
	var billFirstName=document.offer.billFirstName
	var billLastName=document.offer.billLastName
	var billAddress1=document.offer.billAddress1
	
	var bilCity=document.offer.bilCity
	var billState=document.offer.billState
	var billZip=document.offer.billZip
	var billPhone=document.offer.billPhone
	var billEmail=document.offer.billEmail
	
	
	
	if ((billCountry.value==null)||(billCountry.value=="")){
		alert("Please enter country name")
		billCountry.focus()
		return false
	}
	
	if ((companyName.value==null)||(companyName.value=="")){
		alert("Please enter Company Name")
		companyName.focus()
		return false
	}
	if ((billFirstName.value==null)||(billFirstName.value=="")){
		alert("Please enter city name")
		billFirstName.focus()
		return false
	}


	if ((city.value==null)||(city.value=="")){
		alert("Please enter city name")
		city.focus()
		return false
	}

	if ((state.value==null)||(state.value=="")){
		alert("Please enter state name")
		state.focus()
		return false
	}

	if ((zip.value==null)||(zip.value=="")){
		alert("Please enter zip code")
		zip.focus()
		return false
	}

	if (validatezipcode(zip.value)==false){
			zip.focus()
			return false
		}


	if ((phone.value==null)||(phone.value=="")){
		alert("Please enter phone code")
		phone.focus()
		return false
	}

	if (phonevalidate(phone.value)==false){
			phone.focus()
			return false
		}


	if ((email.value==null)||(email.value=="")){
		alert("Please enter email")
		email.focus()
		return false
	}
	
	if (echeck(email.value)==false){
		email.focus()
		return false
	}
	
	if ((reemail.value==null)||(reemail.value=="")){
		alert("Please enter email")
		reemail.focus()
		return false
	}
	
	if (echeck(reemail.value)==false){
		reemail.focus()
		return false
	}

	if(email.value!=reemail.value)
	{
		alert("Email and re-type email does not match")
		email.focus()
		return false
	}

	if ((hearus.value==null)||(hearus.value=="")){
		alert("Please enter Where did you hear about us?")
		hearus.focus()
		return false
	}
	
	return true

}


function  validateRegister()
{

	var email=document.myform.email
	var pass=document.myform.pass
	var repass=document.myform.repass
	var company=document.myform.company
	var first=document.myform.first
	var last=document.myform.last

	var address1=document.myform.address1
	var city=document.myform.city
	var state=document.myform.state
	var zip=document.myform.zip
	var phone=document.myform.phone
	
	if ((email.value==null)||(email.value=="")){
		alert("Please enter email")
		email.focus()
		return false
	}
	
	if (echeck(email.value)==false){
		email.focus()
		return false
	}
	
	if ((pass.value==null)||(pass.value=="")){
		alert("Please enter password")
		pass.focus()
		return false
	}

	if ((repass.value==null)||(repass.value=="")){
		alert("Please retype password")
		repass.focus()
		return false
	}

	if (pass.value!=repass.value){
		alert("Password and retype password does not match");
		pass.focus()
		return false
	}


	if ((company.value==null)||(company.value=="")){
		alert("Please enter company")
		company.focus()
		return false
	}

	if ((first.value==null)||(first.value=="")){
		alert("Please enter first name")
		first.focus()
		return false
	}

	if ((last.value==null)||(last.value=="")){
		alert("Please enter last name")
		last.focus()
		return false
	}

	if ((address1.value==null)||(address1.value=="")){
		alert("Please enter address1")
		address1.focus()
		return false
	}

	if ((city.value==null)||(city.value=="")){
		alert("Please enter city")
		city.focus()
		return false
	}

	if ((state.value==null)||(state.value=="")){
		alert("Please enter state")
		state.focus()
		return false
	}

	if ((zip.value==null)||(zip.value=="")){
		alert("Please enter zip")
		zip.focus()
		return false
	}

	if (validatezipcode(zip.value)==false){
			zip.focus()
			return false
		}
	
	if ((phone.value==null)||(phone.value=="")){
		alert("Please enter phone")
		phone.focus()
		return false
	}

	if (phonevalidate(phone.value)==false){
			phone.focus()
			return false
		}

	return true;


}


//******************************************************************************************************************
var adv = 1;
var flag;


function ShowAdds(a, fl)
{
	flag = fl;
	var dv;
	for (i = 1; i <= 3; i++)
	{
		//dv=document.getElementById("DivOfMonth" + i);
		if(i==a){
			//dv.style.display = 'block';
		}
		else{
			//dv.style.display = 'none';
		}
	}
 	if(adv == 3){
	 	adv = 1;
	}
	else{
		adv++;
	}
	if(flag == true){
		setTimeout('ShowAdds(adv, true)', 3000);
	}
}

//==Imran =======part 2

<!--
function showNav(){
res = document.getElementById('products');
res.style.display='block';
}

function hideNav(){
res = document.getElementById('products');
res.style.display='none';
}

function showNav1(){
res = document.getElementById('resources');
res.style.display='block';
}

function hideNav1(){
res = document.getElementById('resources');
res.style.display='none';
}

function showNav2(){
res = document.getElementById('about');
res.style.display='block';
}

function hideNav2(){
res = document.getElementById('about');
res.style.display='none';
}

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_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_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];}
}
//-->



function ShowSubNav(id)
{
	
	var totaldiv;
	totaldiv=document.getElementById('totaldiv').value;
	var a = parseInt(totaldiv);
	for(i=1;i<=a;i++)
	{
		nav = document.getElementById("subNav" + i);
		if(id == i){
			nav.style.display='block';
		}else{
			nav.style.display='none';
			}
	}
}



//=====ADDED BY Imran Part 3==================



var pausecontent2=new Array()
pausecontent2[0]=''
pausecontent2[1]=''
pausecontent2[2]=''


/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}


