//image, name and layer set


	function showCountry(curCountry, curCountry2, curCountry3, curCountry4) {
			
			//image control
			
			
				//curCountry2()
								
				
			// if there is a country
				if ( curCountry != "none" ){
					
					//set country for other functions
					
					thisCountry = curCountry3;
					thisCountry2 = curCountry;
					thisCountry3 = curCountry2;
					thisCountry4 = curCountry4;
				
					//show name
				
					document.getElementById('country4').innerHTML = thisCountry4.innerHTML;
					document.getElementById('country4').style.marginLeft = thisCountry4.goleft;
					document.getElementById('country4').style.marginTop = thisCountry4.gotop;
					document.getElementById('country4').style.zIndex = thisCountry4.group;
					document.getElementById('country4').style.backgroundColor = thisCountry4.gobgcolor;
					document.getElementById('country4').style.color = thisCountry4.gocolor;
					document.getElementById('country4').style.border = thisCountry4.goborder;
					document.getElementById('country4').style.padding = thisCountry4.gopadding;
				}
			
				else {
			
					//clear name
					document.getElementById('country4').innerHTML = "";
					document.getElementById('country4').style.marginLeft = 0;
					document.getElementById('country4').style.marginTop = 0;
					document.getElementById('country4').style.zIndex = 0;
					document.getElementById('country4').style.backgroundColor = "";
					document.getElementById('country4').style.color = "";
					document.getElementById('country4').style.border = "";
					document.getElementById('country4').style.padding = "";
	
				}
			
			
				//set link 
				document.getElementById(thisCountry2).href = curCountry3.pages;
				
				//set target
				if (curCountry3.pages !="#") {
					
					document.getElementById(thisCountry2).target = "_self";
				}
			
				else {
			
					document.getElementById(thisCountry2).target = "_self";
			
				}
				if (curCountry3.pages.indexOf("china")>0) {
	               document.getElementById('phonenumber').innerHTML = "Free No. 400 600 9262";
	               document.getElementById('phonenumber').style.display = "block";
				}
	}
	
//hide dealer layer
	function hideDealers(){
	
			document.getElementById('country3').innerHTML = "";
			document.getElementById('country3').style.marginLeft = 0;
			document.getElementById('country3').style.marginTop = 0;
			document.getElementById('country3').style.zIndex = 0;
			document.getElementById('country3').style.backgroundColor = "";
			document.getElementById('country3').style.color = "";
			document.getElementById('country3').style.border = "";
			document.getElementById('country3').style.padding = "";
			
			
			//hide country
			showCountry('none', none, none2)
	
	}
	
	
	
	
//show dealer layer
	function showDealers(){
	
			document.getElementById('country3').innerHTML = thisCountry.innerHTML;
			document.getElementById('country3').style.marginLeft = thisCountry.goleft;
			document.getElementById('country3').style.marginTop = thisCountry.gotop;
			document.getElementById('country3').style.zIndex = thisCountry.group;
			document.getElementById('country3').style.backgroundColor = thisCountry.gobgcolor;
			document.getElementById('country3').style.color = thisCountry.gocolor;
			document.getElementById('country3').style.border = thisCountry.goborder;
			document.getElementById('country3').style.padding = thisCountry.gopadding;
		     if (document.cookie != "") {  
		     if (window.confirm('Remenber my selection 30 days'))
		     {setcookie("Country-selected-adamas", thisCountry.pages);   
		     }
			 return true;
             }   
	}
	
	
// when mouseover dealer layer highlight the country	
	function keepCountry(){
						
			thisCountry3()		
				
	}

	
function setcookie(name,value){   
    var Days = 30;   
    var exp  = new Date();   
    exp.setTime(exp.getTime() + Days*24*60*60*1000);   
    document.cookie = name + "="+ escape (value) + ";expires=" + exp.toGMTString();   
}   
  
function getcookie(name){   
    var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));    
    if(arr != null){   
        return unescape(arr[2]);   
    }else{   
        return "";   
    }   
}   
  
function delcookie(name){   
    var exp = new Date();    
    exp.setTime(exp.getTime() - 1);   
    var cval=getCookie(name);   
    if(cval!=null) document.cookie= name + "="+cval+";expires="+exp.toGMTString();   
}   
  
//delcookie("GD-cms");   

//alert(getcookie("Country-selected-adamas"));     
