// JavaScript Document
function setLinks(pageId){
if(!document.getElementById(pageId+"Lbl"))return;
    var obj=document.getElementById(pageId+"Lbl");
	obj.style.color="red";
	obj.style.cursor="default";
	obj.onmouseover=function(){};
	obj.onmouseout=function(){};
	obj.onclick=function(){};
	obj=document.getElementById(pageId+"Img");
	obj.style.cursor="default";
	obj.style.filter="alpha(opacity=100)";
	obj.style.opacity="1.0";
	obj.style.mozOpacity="1.0";
	obj.onmouseover=function(){};
	obj.onmouseout=function(){};
	obj.onclick=function(){};
}
function linkIt(where){
	var target="";
	if(where=="home"){
		target="index.php";	
	}
	else if(where=="wheels"){
		target="products.php";	
	}
	else if(where=="search"){
		target="search.php";	
	}
	else if(where=="news"){
		target="news.php";	
	}
	else if(where=="home"){
		target="index.php";	
	}
	else if(where=="contact"){
		target="contact.php";	
	}
	else if(where=="dealers"){
		target="dealers.php";	
	}
	else if(where=="gallery"){
		target="gallery.php";	
	}
	else if(where=="admin"){
		target="adminport.php";	
	}
	if(target!=""){
		location.href=target;
	}
		
}
function setTrans(ind,img,txt){
	if(ind==1){
		img.style.filter="alpha(opacity=100)";
		img.style.opacity="1.0";
		img.style.mozOpacity="1.0";	
	}
	else{
		img.style.filter="alpha(opacity=60)";
		img.style.opacity="0.6";
		img.style.mozOpacity="0.6";
	}
	if(txt){
		if(ind==1){
			txt.style.color="red";
		}
		else{
			txt.style.color="white";
		}
	}
}

function setCookie(name, value, expires, path, domain, secure) {
	//if(!expires){
		expires=new Date();
		expires.setYear(expires.getYear()+1);
	//}
  	var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  	document.cookie = curCookie;
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}
function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}

function reloc(ef){
var loc = location.href;
if(ef=="en"){loc=loc.replace(/\/fr\//,"/en/");}
if(ef=="fr"){loc=loc.replace(/\/en\//,"/fr/");}
location.href=loc;
}




