function goToLink(cLink){
    window.location.href = cLink;
}
//********************************************
//	RETURN FULL URL
//********************************************
function getTipsaUrl(){
var myUrl = document.location.href;

myUrl = myUrl.replace(new RegExp(/&/g), "XXX"); 
myUrl = myUrl.replace(new RegExp(/=/g), "YXY"); 
myUrl = myUrl.replace(new RegExp(/#/g), ""); 

return myUrl;
}

function tipFriend(){
	var cUrl = 'smpage.fwx?page=309&tipsaurl=' + getTipsaUrl();
	window.open(cUrl,'','width=340,height=310, scrollbars=no');
	return false;
}
function tipFriend2(){
	var cUrl = 'smpage.fwx?page=1006&tipsaurl=' + getTipsaUrl();
	window.open(cUrl,'','width=340,height=310, scrollbars=no');
	return false;
}
function tipFriendB(){
	var cUrl = 'smpage.fwx?page=588&tipsaurl=' + getTipsaUrl();
	window.open(cUrl,'','width=340,height=310, scrollbars=no');
	return false;
}

function print(cContentId){
  var oDiv = document.getElementById(cContentId);
  var cTpl = "";

  if(typeof(ActiveXObject)!='undefined'){
   try{

    var httpRequest = new ActiveXObject('Msxml2.XMLHTTP');
    httpRequest.open('GET', 'htm/print.htm', false); 
    httpRequest.send(); 
    cTpl = httpRequest.responseText;
    cTpl = cTpl.replace("<<CONTENT>>", oDiv.innerHTML);
    }catch(e){
      cTpl = oDiv.innerHTML;
    }
  }else{
  	cTpl = oDiv.innerHTML + "<SCR" + "IPT>window.print();\n</SCR" + "IPT>";
  }
  
  prt=window.open('','','width=600,height=500, scrollbars=yes');
  prt.document.open();
  prt.document.writeln(cTpl);
  prt.document.writeln();
  prt.document.close();
  return false;

}
function openCenteredWindow(url, name, width, height, scroll) {
leftPos = (screen.width-width)/2
topPos = (screen.height-height)/2



settings="height="+height+",width="+width+",top="+topPos+",left="+leftPos+",scrollbars="+scroll+",toolbar=0"


var w = window.open(url,name,settings)
w.focus();
}

function toggleMenu(id) {
	var oDiv = document.getElementById(id);
	if(oDiv) {
		if(oDiv.style.display == "none") {
			oDiv.style.display = "block";
			oDiv.parentNode.parentNode.style.display = "block";
		}
		else {
			oDiv.style.display = "none";
			oDiv.parentNode.parentNode.style.display = "none";
		}
	}
	return;
}

function PrintProduct(cProdId)
{
	var cUrl = 'smpage.fwx?page=594&product=' + cProdId;
	showPopup(cUrl, 660,602);
}
function PrintProductFS(cProdId)
{
	var cUrl = 'smpage.fwx?page=1012&fsproduct=' + cProdId;
	showPopup(cUrl, 660,650);
}

function showPopup(page, height, width) {
	    var win = null;
            h = height;
            w = width;
            myname = "JSpopup";
            LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
            TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
            settings = 'height='+h+', width='+w+', top='+TopPosition+', left='+LeftPosition+', menubar=no, resizable=yes, scrollbars=yes, status=no'
            win = window.open(page, myname, settings)
}