/*
function popUp(URL) {
	eval("page" + " = window.open(URL, '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=325,height=285');");
}
*/

function x_createModal(state){
	var clickToClose = true; // set to true to close modalby clicking anywhere
	var container = document.getElementById('container'); // page container id
	var modal = document.getElementById('x_modalOverlay'); // modal div id
	var cHeight = (container&&container!='undefined')?container.offsetHeight+"px":"1600px";
	var selects = document.getElementsByTagName('select');
	function off(){modal.style.display='none';for (i=0;i<selects.length;i++){selects[i].style.visibility='visible';}}
	function on(){modal.style.height=cHeight;modal.style.display='block';for(i=0;i<selects.length;i++){selects[i].style.visibility='hidden';}}
	if(!modal||modal=='undefined'){modal=document.createElement('div');modal.id='x_modalOverlay';document.body.appendChild(modal);}
	//if(clickToClose){modal.onclick=off}
	if (state=="on")on();
	if (state=="off" || state=="mss-discount") off();
	if (state="on") {modal.onclick=function(){
				document.getElementById('mss-discount').style.display = 'none';
				//showLayer('itemLayer' , 'off');
				if(clickToClose)off();
			}}
}

function x_onDisplay(on) {
	if (on && on != ""){
		document.getElementById(on).style.display = 'block';
		} 
}
function x_offDisplay(off) {
	if (off && off != ""){
		document.getElementById(off).style.display = 'none';
		x_createModal(off);
		} 
}

/*
var uri = location.href;
var tafLocation = "";
var tellFriend = tafLocation + uri;
*/
/*
function tellaFriend(){
	document.write("<a href=\"javascript:createModal('on'); javascript:onDisplay('mss-tellFriend');\" class=\"email\">");
}

tellaFriend(); */
