// JavaScript Document


var btype=window.XMLHttpRequest;
function getXMLHttpRequest(){
var XmlHttp=null;
//Creating object of XMLHTTP in IE
try
{
  XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e)
{
  try
  {
   XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } 
  catch(oc)
  {
   XmlHttp = null;
  }
}
//Creating object of XMLHTTP in Mozilla and Safari 
if(!XmlHttp && typeof XMLHttpRequest != "undefined") 
{
  XmlHttp = new XMLHttpRequest();
}
if(!XmlHttp)
alert('Sorry. Cannot create an XMLHTTP instance. Please try again');


 return XmlHttp;
}

var yearSelect=false,makeSelect=false,modelSelect=false;
function resultFilter(obj){
	var http_request=getXMLHttpRequest();
	http_request.onreadystatechange=function(){
	if(http_request.readyState==4 && http_request.status==200 ){
		var doc=http_request.responseText;
		//obj.innerHTML=doc;
		var ob=doc.split("1234567890");
		//alert(doc);
		if(!makeSelect)
		document.fo.mk.innerHTML=ob[0];
		if(!modelSelect)
		document.fo.md.innerHTML=ob[1];
		if(!yearSelect)
		document.fo.yy.innerHTML=ob[2];
		alert(ob[0]);
	}
	}
	if(obj.name=="yy")
	yearSelect=true;
	if(obj.name=="mk")
	makeSelect=true;
	if(obj.name=="md")
	modelSelect=true;
	http_request.open('POST',"/Jsp/yearFilter.jsp",true);
	
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http_request.send(obj.name+'='+obj.value);
	
	
	
}
// JavaScript Document
function showResult(obj,surl,showobj){
	var http_request=getXMLHttpRequest();
	http_request.onreadystatechange=function(){
		
	if(http_request.readyState==4 && http_request.status==200 ){
		var doc=http_request.responseText;
	
		var doc2=doc.split("myscript");
		
		if(doc2.length>1){
		var script=document.createElement("script");//在模版页创建新的标签
         script.text=doc2[0];//给新的script标签赋值
        document.getElementsByTagName("head")[0].appendChild(script);//把该标签加入

		document.getElementById(showobj).innerHTML=doc2[1];
		}else
		document.getElementById(showobj).innerHTML=doc;
	
	
		if(parent.document.getElementById('mainshow')!=null)
		parent.document.getElementById('mainshow').height=parent.mainshow.document.documentElement.scrollHeight;
		if(parent.document.getElementById('sparea')!=null)
		parent.document.getElementById('sparea').height=parent.sparea.document.documentElement.scrollHeight;
		
	}
	}
	
	document.getElementById(showobj).innerHTML='Data is being processed ......';
	
	var els=obj.elements;
	var l=els.length;
	
	var param="";
	for (i=0;i<l;i++){
		if((els[i].type!="checkbox" && els[i].type!="radio") || els[i].checked )
		param+=(param.length > 0 ? "&" : "")+els[i].name+"="+escape(els[i].value);
		
	}

	http_request.open('POST',surl+".jsp",true);
	
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	//http_request.send(obj.name+'='+obj.value);
	http_request.send(param);
	
	
	
	
}

function openScript(url,name,width,height)
{
var Win = window.open(url,name,'width=' + width + ',height=' + height + ',resizable=0,top=0,left=0,scrollbars=yes,location=no,menubar=no,status=no');
}

function closewindow(obj){



if(obj==1){
if(window.opener!=null)
window.opener.location.reload();
//window.opener.parent.location.reload();
}
window.close();
}

function vieworder(obj){

openScript('orderdetails.jsp?orderid='+obj,'','920','500');


}


function getEvt(event){

event = event || window.event;
return event;

}

function printPage() {
var conhtml=document.getElementById('control').innerHTML;
var condhtml;
if(document.getElementById('cond')!=null){
condhtml=document.getElementById('cond').innerHTML;
document.getElementById('cond').innerHTML="";
}
document.getElementById('control').innerHTML="";

window.print();
//document.all.wbprint.ExecWB(6,6);
document.getElementById('control').innerHTML=conhtml;
if(document.getElementById('cond')!=null)
document.getElementById('cond').innerHTML=condhtml;
//document.getElementById('control').style.display='block';

}
function printPage2() {
var conhtml=document.getElementById('control').innerHTML;
document.getElementById('control').innerHTML="";
window.print();
//document.all.wbprint.ExecWB(6,6);
document.getElementById('control').innerHTML=conhtml;
//document.getElementById('control').style.display='block';

}

function printSetup(){
wbprint.ExecWB(8,1);
}
function printView(){
document.getElementById('control').style.display='none';
wbprint.ExecWB(7,1);
document.getElementById('control').style.display='block';
}

function fetchPage(obj0,obj,obj2){

document.getElementById(obj0).pi.value=obj;
if(document.getElementById(obj0).o!=null)
document.getElementById(obj0).o.value=obj2;
if(document.getElementById(obj0).tot!=null)
document.getElementById(obj0).tot.value=obj2;
document.getElementById(obj0).submit();
}

function goPage(obj){
	document.location.href=document.location.href.replace(/(.*\/items-)(\d+)(\.html.*)/,"$1"+obj+"$3");
}

function fetchPage2(obj0,obj,obj2){

document.getElementById(obj0).pi.value=obj;
execOrder(document.getElementById(obj0),obj2);
}

function fetchPage3(obj){
document.location.href=document.location.href.replace(/&pi=\d&/,"&pi="+obj+"&");
}

String.prototype.trim = function() 
{ 
return this.replace(/(^\s*)|(\s*$)/g, ""); 
} 

function isNum(obj){
	var rule=/^-?\d+(\.\d{1,2})?$/;
	
	var r=rule.test(obj.trim());
	
	return  r;
	
	
}

function execOrder(obj,obj2){

showResult(obj,obj2,'content');
}

function execOrder2(obj,obj2,obj3){
	
obj.tot.value=obj3;

showResult(obj,obj2,'content');
}

function execOrder3(obj,obj3){
	
obj.tot.value=obj3;

obj.submit();
}

function viewinvoice(obj){

openScript('invoicedetails.jsp?invoiceid='+obj,'','920','500');

}

function viewvinvoice(obj,obj2){

openScript('vinvoicedetails.jsp?vinvoiceid='+obj+'&vendorid='+obj2,'','800','500');

}

function emailfriend(bid,cid,pid,purl,title){

openScript('/Jsp/content/email_product.jsp?bid='+bid+'&cid='+cid+'&pid='+pid+'&purl='+purl+'&title='+title,'','800','500');

}

function review(obj,obj2){
openScript('review.jsp?pid='+obj+'&invoiceid='+obj2,'','600','620');	
}

function viewrefund(obj){

openScript('refunditemdetails.jsp?refundid='+obj,'','1002','500');

}


function showContent(obj){

document.getElementById(obj).style.display="block";
if(parent.document.getElementById('mainshow')!=null)
parent.document.getElementById('mainshow').height=parent.mainshow.document.body.scrollHeight;
}




function printSetup2(){

var MyObject = new ActiveXObject("wscript.Shell");
var margin_left=MyObject.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\margin_left");
var margin_right=MyObject.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\margin_right");
var margin_bottom=MyObject.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\margin_bottom");
var margin_top=MyObject.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\margin_top");
var footer=MyObject.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\footer");
var header=MyObject.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\header");
MyObject.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\margin_left","0.49");
MyObject.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\margin_right","0.39");
MyObject.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\margin_bottom","0.39");
MyObject.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\margin_top","0.19");
MyObject.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\footer","");
MyObject.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\header","");

printPage();
MyObject.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\margin_left",margin_left);
MyObject.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\margin_right",margin_right);
MyObject.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\margin_bottom",margin_bottom);
MyObject.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\margin_top",margin_top);
MyObject.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\footer",footer);
MyObject.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Internet Explorer\\PageSetup\\header",header);
}

function getUrl(obj){
document.location.href="/Jsp/content/productinfo.jsp?pid="+obj;
}

	function trimAll( strValue ) {
	/************************************************
	DESCRIPTION: Removes leading and trailing spaces.
	
	PARAMETERS: Source string from which spaces will
	  be removed;
	
	RETURNS: Source string with whitespaces removed.
	*************************************************/
	 var objRegExp = /^(\s*)$/;
	
		//check for all spaces
		if(objRegExp.test(strValue)) {
		   strValue = strValue.replace(objRegExp, '');
		   if( strValue.length == 0)
			  return strValue;
		}
	
	   //check for leading & trailing spaces
	   objRegExp = /^(\s*)([\W\w]*)(\b\s*$)/;
	   if(objRegExp.test(strValue)) {
		   //remove leading and trailing whitespace characters
		   strValue = strValue.replace(objRegExp, '$2');
		}
	  return strValue;
	}
	
	function IsNumeric(sField, mess)
			{
				var ValidChars = "0123456789";
				var IsNumber=true;
				var Char;
				myString = new String(sField.value);
				
				for (i = 0; i < sField.value.length && IsNumber == true; i++) 
				{ 
					Char = myString.charAt(i); 
					if (ValidChars.indexOf(Char) == -1) 
					{
						IsNumber = false;
						alert(mess);
						sField.value = "";
						sField.focus();	
					}
				}
				return IsNumber;   
			}
	
	function validateNotEmpty(strValue) {
	/************************************************
	DESCRIPTION: Validates that a string is not all
	  blank (whitespace) characters.
	
	PARAMETERS:
	   strValue - String to be tested for validity
	
	RETURNS:
	   True if valid, otherwise false.
	*************************************************/
	   var strTemp = strValue;
	   strTemp = trimAll(strTemp);
	   if(strTemp.length > 0){
		 return true;
	   }
	   return false;
	}
	
	function validateValue(theField, minLength, maxLength, fieldName) {
		if(!validateNotEmpty(trimAll(theField.value))){
			window.alert("Please enter "+fieldName+".");
			try {theField.focus();} catch(e) {}
		return false;
		}
		var valid=false;
		var errorMsg="";
	
		if(theField.value == null)
			errorMsg = "Please enter "+fieldName+".";
		else if (theField.value.length==0)
			errorMsg = "Please enter "+fieldName+".";
		else if (theField.value.length<minLength || theField.value.length>maxLength)
			errorMsg = "Please enter "+fieldName+".";
		else
			valid = true;
	
		if (valid==false) {
			window.alert(errorMsg);
			try {theField.focus();} catch(e) {}
		}
	
		return valid;
	}
function check_cbox(obj){

var sid=1;

for(var i=1;i<=obj;i++){
if(document.getElementById("checkbox"+i).checked){

sid++;
break;
}
}

if(sid==1 ){

return false;
}
else
return true;
}

function validateEmail(strValue) {
	/************************************************
	DESCRIPTION: Validates that a string contains a
	  valid email pattern.
	
	 PARAMETERS:
	   strValue - String to be tested for validity
	
	RETURNS:
	   True if valid, otherwise false.
	
	REMARKS: Accounts for email with country appended
	  does not validate that email contains valid URL
	  type (.com, .gov, etc.) or valid country suffix.
	*************************************************/

		
		var objRegExp  = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*\.(\w{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/;
		
		//check for valid email
		if(!objRegExp.test(strValue))
			return false;
		else
			return true;
		
	}
	
function validateState(theField)
	{	
		if (theField.value=="ZZ" || theField.value.trim().length==0)
			{
				alert("Your State / Province / Region is empty!");
				theField.focus();
				return false;
			}
	}


//advance search
Array.prototype.unique = function()
{
  var a = {}; 
  for(var i=0; i<this.length; i++)
  {
  	if(typeof a[this[i]] == "undefined")
      a[this[i]] = 1;
  }
  this.length = 0;

 
  for(var i in a){

    this[this.length] = i;
  }
  return this;
}




function vvc(obj){
if(obj.mk.value=="" && obj.md.value=="" && obj.yy.value=="" && obj.bd.value=="" && obj.dt.value=="" && obj.cg.value==""){
alert("Please select search options.");
return false;
}
else
return true;
}



var cc1=1;
var si1=1;
var tcv0=0;
function dd(obj){
//alert(cc2);

if(!testVer()){
if(cc1%2!=0)
setWidth(obj,1,200);
//else
//setWidth(obj,2,200);
cc1++;
document.getElementById('Layer2').style.left=-65;
if(obj.selectedIndex!=tcv0 || (tcv0!=0 && cc1%2!=0) ){
	setWidth(obj,2,210);
	cc1=1;
	tcv0=obj.selectedIndex;
}

obj.onblur=function(){
setWidth(obj,2,200);
cc1=1;
}

}else{
//alert(cc2);
if(cc1%2!=0)
setWidth(obj,1,200);
//else
//setWidth(obj,2,200);
cc1++;
//si1=obj.selectedIndex;
document.getElementById('Layer2').style.left=-65;
if(obj.selectedIndex!=tcv0 || (tcv0!=0 && cc1%2!=0) ){
	setWidth(obj,2,210);
	cc1=1;
	tcv0=obj.selectedIndex;
}

obj.onblur=function(){
setWidth(obj,2,200);
cc1=1
//obj.selectedIndex=si1;
}
}

}

var cc2=1;
var si2=1;
var tcv=0;
function dd2(obj){
//alert(cc2);

if(!testVer()){
if(cc2%2!=0)
setWidth(obj,1,250);
//else
//setWidth(obj,2,210);
cc2++;
document.getElementById('Layer1').style.left=-115;
if(obj.selectedIndex!=tcv || (tcv!=0 && cc2%2!=0) ){
	setWidth(obj,2,210);
	cc2=1;
	tcv=obj.selectedIndex;
}
obj.onblur=function(){
setWidth(obj,2,210);
cc2=1

}




}else{
//alert(cc2);
if(cc2%2!=0)
setWidth(obj,1,250);
//else
//setWidth(obj,2,210);
cc2++;
//si2=obj.selectedIndex;
document.getElementById('Layer1').style.left=-115;

if(obj.selectedIndex!=tcv || (tcv!=0 && cc2%2!=0) ){
	setWidth(obj,2,210);
	cc2=1;
	tcv=obj.selectedIndex;
}

obj.onblur=function(){
setWidth(obj,2,210);
cc2=1
//obj.selectedIndex=si2;
}
}

}


function testVer(){
IEVer = window.navigator.appVersion;
IEVer = IEVer.substr( IEVer.indexOf('MSIE') + 5, 3 ); 
if(IEVer<=6.0)
return true;
else
return false;
}

function setWidth(obj,i,w){
if(i==1){
var cl2=obj.options.length;
//window.clearTimeout(idc);

obj.style.width=w+'px';
if(cl2<10)
obj.size=cl2;
else
obj.size=10;

}
else{
obj.style.width='135px';
obj.size=1;
document.getElementById('Layer1').style.left=0;
document.getElementById('Layer2').style.left=0;
}
}
//-----------------------------------


function setAllMake(){
//if(document.advance.mk.options.length==1){
var l=makeAllArray.length;

for(var i=0;i<l;i++){
document.advance.mk.options.add(new Option(makeAllArray[i][0],makeAllArray[i][0]));
}
//}
}

function setAllModel(){
document.advance.md.options.length=1;
if(document.advance.mk.options[1].value=="ZZZZZA")
makeIndex=document.advance.mk.selectedIndex-2;
else
makeIndex=document.advance.mk.selectedIndex-1;

if(makeIndex>=0){
document.advance.md.disabled=false;
var modelArray=makeAllArray[makeIndex][1];
var l=modelArray.length;
//start for
for( var i=0;i<l;i++){
document.advance.md.options.add(new Option(modelArray[i].split("mysplit")[0],modelArray[i].split("mysplit")[0]));
var tyearArray=makeAllArray[makeIndex][2][i];
var startYear=tyearArray[0];
var endYear=tyearArray[1];
if(startYear>0){

while(startYear<=endYear ){ 
allYearArray.push(startYear);
startYear++;
}
}
}//end for
if(document.advance.yy!=null){
allYearArray.unique();
allYearArray.sort();
document.advance.yy.options.length=1;
var l2=allYearArray.length;

for( var i=0;i<l2;i++){
document.advance.yy.options.add(new Option(allYearArray[i],allYearArray[i]));
}
}
//end yy undefine
}
}

function setAllYear(){
document.advance.yy.options.length=1;
var modelIndex=document.advance.md.selectedIndex-1;
if(document.advance.mk.options[1].value=="ZZZZZA")
makeIndex=document.advance.mk.selectedIndex-2;
else
makeIndex=document.advance.mk.selectedIndex-1;
if(modelIndex>=0){
document.advance.yy.disabled=false;
var yearArray=makeAllArray[makeIndex][2][modelIndex];
var startYear=yearArray[0];
var endYear=yearArray[1];
//alert(starYear);
if(startYear>0){

while( startYear<=endYear){
document.advance.yy.options.add(new Option(startYear,startYear));
startYear++;
}
}
}else{
var l2=allYearArray.length;
for( var i=0;i<l2;i++){
document.advance.yy.options.add(new Option(allYearArray[i],allYearArray[i]));
}
}
}





function setAllDepart(){

if(document.advance.dt.options.length==1){
var l=departArray.length;
for(var i=0;i<l;i++){
document.advance.dt.options.add(new Option(departArray[i][0],departArray[i][0]));
}
}
}

function setAllcategory(){
var departIndex=document.advance.dt.selectedIndex-1;
document.advance.cg.options.length=1;
if(departIndex>=0){
var categoryArray=departArray[departIndex][1];
var cl=categoryArray.length;

for(var i=0;i<cl;i++){
if(categoryArray[i].split("mysplit")[2]==0)
document.advance.cg.options.add(new Option(categoryArray[i].split("mysplit")[0],categoryArray[i].split("mysplit")[0]));
}
}
}
function getCl(){
return cl;
}



//end advance search

//fitmycarsearch
function setAllMake2(){

if(document.fitmycar!=null && document.fitmycar.mkv.options.length==1){
var l=makeAllArray.length;
for(var i=0;i<l;i++){
document.fitmycar.mkv.options.add(new Option(makeAllArray[i][0],makeAllArray[i][0]));
}
}

}

//var makeIndex;
//var allYearArray=new Array();

function setAllModel2(){
document.fitmycar.mdv.options.length=1;
document.fitmycar.yyv.options.length=1;
makeIndex=document.fitmycar.mkv.selectedIndex-1;

if(makeIndex>=0){
document.fitmycar.mdv.disabled=false;

var modelArray=makeAllArray[makeIndex][1];
var l=modelArray.length;
for( var i=0;i<l;i++){
document.fitmycar.mdv.options.add(new Option(modelArray[i].split("mysplit")[0],modelArray[i].split("mysplit")[0]));
var tyearArray=makeAllArray[makeIndex][2][i];
var startYear=tyearArray[0];
var endYear=tyearArray[1];
while(startYear<=endYear){
allYearArray.push(startYear);
startYear++;
}
}
//allYearArray.unique();
//allYearArray.sort();
document.fitmycar.yyv.options.length=1;
var l2=allYearArray.length;
for( var i=0;i<l2;i++){
document.fitmycar.yyv.options.add(new Option(allYearArray[i],allYearArray[i]));
}
}
}

function setAllcategory2(){
var departIndex=document.advance.dt.selectedIndex-1;
document.advance.cg.options.length=1;
if(departIndex>=0){
var categoryArray=departArray[departIndex][1];
var cl=categoryArray.length;

for(var i=0;i<cl;i++){
document.advance.cg.options.add(new Option(categoryArray[i].split("mysplit")[0],categoryArray[i].split("mysplit")[1]));
}
}
}


function setAllYear2(){
var modelIndex=document.fitmycar.mdv.selectedIndex-1;
if(modelIndex>=0){
document.fitmycar.yyv.disabled=false;
document.fitmycar.yyv.options.length=1;
var yearArray=makeAllArray[makeIndex][2][modelIndex];
var startYear=yearArray[0];
var endYear=yearArray[1];
while( startYear<=endYear){
document.fitmycar.yyv.options.add(new Option(startYear,startYear));
startYear++;
}
}else{
var l2=allYearArray.length;
for( var i=0;i<l2;i++){
document.fitmycar.yyv.options.add(new Option(allYearArray[i],allYearArray[i]));
}
}
}

//end fitmycarsearch

//newclear
function right(obj){

//c=c-149;
if(newclear_rm==null)
{
 newclear_rm=setInterval (function(){movieright1(obj);},50);
//document.getElementById("newarrival").style.left=c;
//alert(document.getElementById("newarrival").style.left);
}
//if(c<0)
//document.getElementById("l1").innerHTML="<img  src=\"/Picture/NewArrival/left.jpg\" onClick=\"left();\" onMouseOver=\"this.style.cursor='pointer';\" />";

}
function movieright1(obj){//缓动
var ob1=document.getElementById("newarrival");
var dx=(newclear_r1+1)*newclear_n1+newclear_c;
newclear_c+=dx*newclear_fx1;
newclear_c=Math.floor(newclear_c);
ob1.style.left=newclear_c+'px';


if(newclear_c<0)
document.getElementById("l1").innerHTML="<img  src=\"/Picture/NewArrival/left.jpg\" onClick=\"left("+obj+");\" onMouseOver=\"this.style.cursor='pointer';\"  title=\"Previous\" />";
if((newclear_r1+1)*4>=(obj-5))
document.getElementById("r1").innerHTML="<img  src=\"/Picture/NewArrival/right2.jpg\"  />";


if(dx==0){
newclear_r1++;

clearInterval(newclear_rm);
newclear_rm=null;
//alert(obj+'nn'+newclear_r1);
}
}
function movieleft1(obj){//缓动
var ob1=document.getElementById("newarrival");
var dx=(newclear_r1-1)*newclear_n1+newclear_c;
newclear_c+=dx*newclear_fx1;
newclear_c=parseInt(newclear_c);
ob1.style.left=newclear_c+'px';

if(newclear_c>=0)
document.getElementById("l1").innerHTML="<img  src=\"/Picture/NewArrival/left2.jpg\"  />";

if(dx==0){

newclear_r1--;
if(newclear_r1<(obj-4))
document.getElementById("r1").innerHTML="<img  src=\"/Picture/NewArrival/right.jpg\" onClick=\"right("+obj+");\" onMouseOver=\"this.style.cursor='pointer';\"  title=\"Next\" />";
clearInterval(newclear_rm);
newclear_rm=null;
//alert('nn'+c);
}
}

function movieright2(obj){//缓动
var ob1=document.getElementById("monthclear");
var dx=(newclear_r2+1)*newclear_n1+newclear_c2;
newclear_c2+=dx*newclear_fx1;
newclear_c2=Math.floor(newclear_c2);
ob1.style.left=newclear_c2+'px';

if(newclear_c2<0)
document.getElementById("l2").innerHTML="<img  src=\"/Picture/NewArrival/left.jpg\" onClick=\"left2("+obj+");\" onMouseOver=\"this.style.cursor='pointer';\" title=\"Previous\" />";

if((newclear_r2+1)*4>=(obj-5))
document.getElementById("r2").innerHTML="<img  src=\"/Picture/NewArrival/right2.jpg\"  />";

if(dx==0){
newclear_r2++;
clearInterval(newclear_rm);
newclear_rm=null;
//alert('nn'+c2);
}
}
function movieleft2(obj){//缓动
var ob1=document.getElementById("monthclear");
var dx=(newclear_r2-1)*newclear_n1+newclear_c2;
newclear_c2+=dx*newclear_fx1;
newclear_c2=parseInt(newclear_c2);
ob1.style.left=newclear_c2+'px';

if(newclear_c2>=0)
document.getElementById("l2").innerHTML="<img  src=\"/Picture/NewArrival/left2.jpg\"  />";

if(dx==0){
newclear_r2--;
if(newclear_r2<obj-4)
document.getElementById("r2").innerHTML="<img  src=\"/Picture/NewArrival/right.jpg\" onClick=\"right2("+obj+");\" onMouseOver=\"this.style.cursor='pointer';\"  title=\"Next\" />";
clearInterval(newclear_rm);
newclear_rm=null;
}
}

function left(obj){
if(newclear_rm==null)
{

 newclear_rm=setInterval (function(){movieleft1(obj);},50);
 }

}

//monthclear

function right2(obj){
// alert(document.getElementById("monthclear").style.left+c2);
if(newclear_rm==null)
{

 newclear_rm=setInterval (function(){movieright2(obj);},50);
 }

}
function left2(obj){
// alert(document.getElementById("monthclear").style.left+c2);
if(newclear_rm==null)
{

 newclear_rm=setInterval (function(){movieleft2(obj);},50);
 }

}
//end newclear

//searchfecth
function qfocus(){
if(document.getElementById("q").value=="Keyword")
document.getElementById("q").value="";
document.getElementById("p").value='SKU#';
document.getElementById("q").className='Black12b';
document.getElementById("p").className='gray12';
}


function pfocus(){
if(document.fs.p.value=="SKU#") 
document.fs.p.value="";
document.fs.q.value="Keyword";
document.getElementById("p").className='Black12b';
document.getElementById("q").className='gray12';
}
function qonblur(){
if(document.activeElement.name!=document.fs.q.name && document.activeElement.name!=document.fs.p.name){
if((document.fs.q.value.length==0 || document.fs.q.value=='Keyword') && (document.fs.p.value=='SKU#' ||document.fs.p.value.length==0 ) ){
document.fs.p.value=pvalue;
document.fs.q.value=qvalue;
if(qvalue!='Keyword'){
document.getElementById("q").className='Black12b'
document.getElementById("p").className='gray12';
}
else if(pvalue!='SKU#'){
document.getElementById("P").className='Black12b';
document.getElementById("q").className='gray12';
}
else{
	document.getElementById("P").className='gray12';
document.getElementById("q").className='gray12';
}

}
}
}
//end searchfecth

//search order
function setYears(){
document.fo.yy.options.length=1;
var modelIndex=document.fo.md.selectedIndex-1;
if(modelIndex>=0){
var yearArray=makeArray[makeIndex][2][modelIndex];
var startYear=yearArray[0];
var endYear=yearArray[1];
while( startYear<=endYear){
document.fo.yy.options.add(new Option(startYear,startYear));
startYear++;
}
}else{
var l2=FilterYearArray.length;
for( var i=0;i<l2;i++){
document.fo.yy.options.add(new Option(FilterYearArray[i],FilterYearArray[i]));
}
}
}
//end search order


//back
function setAllModel3(){
document.advance.md.options.length=1;
//document.advance.yy.options.length=1;
makeIndex=document.advance.mk.selectedIndex-1;

if(makeIndex>=0){

document.advance.md.disabled=false;
var modelArray=makeAllArray[makeIndex][1];
var l=modelArray.length;
for( var i=0;i<l;i++){

document.advance.md.options.add(new Option(modelArray[i].split("mysplit")[0],modelArray[i].split("mysplit")[1]));

}
}
}

function setDay(year,month,day){
	var indexy=year.selectedIndex-1;
	var indexm=month.selectedIndex-1;
	if(indexy>=0 && indexm>=0){
		var days=cal[indexy][1][indexm];
		day.options.length=1;
		for(i=1;i<=days;i++){
		if(i<10)
		day.options.add(new Option("0"+i,"0"+i));
		else
		day.options.add(new Option(i,i));
		}
		day.selectedIndex=1;
	}
}

function disableclick(e) {
if (document.all) {
if (event.button==2||event.button==3) {
if (event.srcElement.tagName=="IMG"){
alert("Welcome!");
return false;
}
}
}
}

 


