function openpage(url){
    width=820;
	height=720;
	left=(screen.width-width)/2;
	top2=(screen.height-height)/2-30;
    window.open(url,"","scrollbars=no,left="+left+",top="+top2+",height="+height+",width="+width);
}


function swf(name,width,height,transparent){
    document.write("<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='"+width+"' height='"+height+"'>");
    document.write("<param name='movie' value='"+name+"'>");
    document.write("<param name='quality' value='high'>");
    document.write("<param name='menu' value='false'>");
    if(transparent==1) document.write("<param name='wmode' value='transparent'>");
    document.write("<embed src='"+name+"' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='"+width+"' height='"+height+"'></embed>");
    document.write("</object>");
}

function DrawImage(ImgD,w,h){
   xwidth=w;
   xheight=h;
   var image=new Image();
   image.src=ImgD.src;
   if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= xwidth/xheight){
     if(image.width>xwidth){  
     ImgD.width=xwidth;
     ImgD.height=(image.height*xwidth)/image.width;
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }

     }
    else{
     if(image.height>xheight){  
     ImgD.height=xheight;
     ImgD.width=(image.width*xheight)/image.height;     
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }

     }
    }
}

function guanggao(width,height,name,pic,links){
    var textheight=0
	var focus_width=width
	var focus_height=height
	var swf_height = focus_height
	var names=name
	var pics=pic
document.write("<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0' width='"+ focus_width +"' height='"+ (swf_height+textheight) +"'>");
	document.write("<param name='allowScriptAccess' value='sameDomain'><param name='movie' value='./index/playswf.swf'><param name=wmode value=transparent><param name='quality' value='high'>");
	document.write("<param name='menu' value='false'><param name='wmode' value='opaque'>");
	document.write("<param name='FlashVars' value='texts="+names+"&pics="+pics+"&links="+links+"&borderwidth="+focus_width+"&borderheight="+focus_height+"&textheight="+textheight+"'>");
	document.write("<embed src='./index/playswf.swf' wmode='opaque' FlashVars='texts="+names+"&pics="+pics+"&links="+links+"&borderwidth="+focus_width+"&borderheight="+focus_height+"&textheight="+textheight+"' menu='false' bgcolor='#DADADA' quality='high' width='"+ focus_width +"' height='"+ (swf_height+textheight) +"' allowScriptAccess='sameDomain' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />");
	document.write("</object>");	
}


function PicFocus_(imageContainerID,textContainerID,buttonContainerID,intervarTime) {
var a=new PicFocus(imageContainerID,textContainerID,buttonContainerID,intervarTime);
a.init();
a.play();
}    
if(typeof PicFocusManager == "undefined")
{
PicFocusManager =[];
}

function PicFocus(imageContainerID,textContainerID,buttonContainerID,intervarTime){
this.$ = function (id){return document.getElementById(id)}
this.index = PicFocusManager.length;
PicFocusManager[PicFocusManager.length] = this;
this.imageContainer = this.$(imageContainerID);
this.textContainer = this.$(textContainerID);
this.buttonContainer = this.$(buttonContainerID);
this.firstShow = 0; //默认显示项
this.interval = (isNaN(intervarTime)?0:intervarTime) || 5000;
//切换时间
this.canAutoPlay = true; //是否可以自动切换
this.currentPosition = this.firstShow;
this.timer;
this.images = [];
this.texts = [];
this.buttons = [];
this.callback=function(){};
this.bindEvent = function(){
var _self = this;
for(var i=0;i<this.images.length;i++){
this.images[i].onmouseover = function(){
_self.stop();
}
this.images[i].onmouseout = function(){
_self.timer = setTimeout('PicFocusManager[' + _self.index + '].play()' , _self.interval )
}
}
for(var i=0;i<this.buttons.length;i++){
this.buttons[i].onclick = function(){
_self.focus(this);
}
}
}
this.play = function(){
this.stop();
if(this.canAutoPlay){
this.setFocus(this.currentPosition ++ )
if(this.currentPosition >= this.images.length)this.currentPosition =0 ;
}
this.timer = setTimeout('PicFocusManager[' + this.index + '].play()' , this.interval )
}
this.stop = function(){
clearTimeout( this.timer );
}
this.focus = function(button){
for(var i=0;i<this.buttons.length;i++){
if(this.buttons[i] == button){
this.currentPosition = i;
this.setFocus(this.currentPosition);
break;
}
}
}
this.setFocus = function(i){
if(/Microsoft/.test(navigator.appName)){
this.imageContainer.filters[0].apply();
this.imageContainer.filters[0].play();
}
for(var j=0;j<this.images.length;j++){
this.images[j].style.display = (i==j)?"":"none";
}
for(var j=0;j<this.texts.length;j++){
this.texts[j].style.display = (i==j)?"":"none";
}
for(var j=0;j<this.buttons.length;j++){
this.buttons[j].className = (i==j)? this.buttons[j].getAttribute("focusClass") :this.buttons[j].getAttribute("normalClass");
}
if(/Microsoft/.test(navigator.appName)){  //滤镜版本
new ActiveXObject("DXImageTransform.Microsoft.Fade");
this.imageContainer.filters[0].play();
}
this.callback(i);
}
this.init = function(){
if(this.imageContainer && this.buttonContainer){
//init
this.images=this.imageContainer.getElementsByTagName("img");
if(this.textContainer) this.texts=this.textContainer.getElementsByTagName("label");
this.buttons=this.buttonContainer.getElementsByTagName("a");
this.bindEvent();
for(var i=0;i<this.images.length;i++){
this.images[i].style.display = "none";
if(i<this.texts.length) this.texts[i].style.display = "none";
this.buttons[i].className = this.buttons[i].getAttribute("normalClass");
this.buttons[i].target="_self";
}
this.images[this.firstShow].style.display = "";
if(this.firstShow<this.texts.length) this.texts[this.firstShow].style.display = "";
this.buttons[this.firstShow].className = this.buttons[this.firstShow].getAttribute("focusClass");
}else{
alert("未提供正确的参数")
}
}
}

function changeclass(ids,ids1){
//$("td").hasClass("pinpai2").addClass("pinpai1");
$("#p1").removeClass("pinpai2");
$("#p2").removeClass("pinpai2");
$("#p3").removeClass("pinpai2");
$("#p4").removeClass("pinpai2");
$("#p5").removeClass("pinpai2");
$("#p6").removeClass("pinpai2");
$("#p1").addClass("pinpai1");
$("#p2").addClass("pinpai1");
$("#p3").addClass("pinpai1");
$("#p4").addClass("pinpai1");
$("#p5").addClass("pinpai1");
$("#p6").addClass("pinpai1");
$("#p11").hide();
$("#p22").hide();
$("#p33").hide();
$("#p44").hide();
$("#p55").hide();
$("#p66").hide();
$("#"+ids).addClass("pinpai2");
$("#"+ids1).show();
}
function checks()
{
	
}

function changshowp(currentid,showcount){
    var showp,showlc;
	for(i=0;i<=showcount;i++){
	   	showp=document.getElementById("showp"+i);
		if(i==currentid){
		   	showp.className="product1_show";
			document.getElementById("bigpic").src=document.getElementById("ppic"+i).value;
			showlc=document.getElementById("showlocation");
			showlc.innerHTML="&nbsp;>&nbsp;"+document.getElementById("pname"+i).value;
		}else{			
		   	showp.className="product1_hide";
		}
	}
}



function sendmailisok2(obj){
 if(obj.name.value==""){
	alert("Please input your name!");
	obj.name.focus();
	return false;
 }
 if(obj.email.value==""){
	alert("Please input your email!");
	obj.email.focus();
	return false;
 }
	
 var radio1="";
 for(i=0;i<obj.a.length;i++){		    	    
	if(obj.a[i].checked){
		if(i==0){
		   radio1="yes";
		}
		else{
		   radio1="no";
		}
		break;
	}
 }
 
 var radio2="";
 for(i=0;i<obj.b.length;i++){		    	    
	if(obj.b[i].checked){
		if(i==0){
		   radio2="yes";
		}
		else{
		   radio2="no";
		}
		break;
	}
 }
 
 if(obj.c.checked){
	c="yes";
 }else{
	c="no";
 }
 
 var str;
 str="Name:"+obj.name.value;
 str+="<br>Email:"+obj.email.value;
 str+="<br>Telephone:"+obj.tel.value;
 str+="<br>Company:"+obj.company.value;
 str+="<br>Address:"+obj.address.value;
 str+="<br>if yes please put your address in the field above:"+radio1;
 str+="<br>Product/s:"+obj.products.value;
 str+="<br>Quantities:"+obj.quantities.value;
 str+="<br>Branding:"+radio2;
 str+="<br>Other Details:"+obj.details.value;
 str+="<br>Check here if you don't wish to be on our mailing list:"+c;
 obj.dhtml.value=str;
 
 //openNewDiv('newDiv','c','');
 return true;
}

function findisok(obj){
  if(obj.keyword.value=="Enter keyword or model#") obj.keyword.value="";
  return true;
}

function changpic(url){
	document.getElementById("borwsepic").src = url;
	//document.getElementById("pic").value = pic;
}
