
// START NEW FUNCTIONS FOR NEW HEADER //
// added 1/3/2007 //

// JavaScript Document
var imgPath = "/media/images/common/";
function swapImg(elm)	{
	var obj = document.getElementById(elm);
	obj.src = imgPath+elm+"_over.jpg";
}
function swapImgBack(elm)	{
	var obj = document.getElementById(elm);
	obj.src = imgPath+elm+".jpg";
}

function swapNav(elm){
	var obj = document.getElementById(elm);
	obj.src = "images/header/"+elm+"_over.gif";
}
		
function swapNavBack(elm){
	var obj = document.getElementById(elm);
	obj.src = "images/header/"+elm+".gif";
}

function swapTab(elm){
	var obj = document.getElementById(elm);
	obj.src = "images/header/"+elm+"_on.gif";
}
		
function swapTabBack(elm){
	var obj = document.getElementById(elm);
	obj.src = "images/header/"+elm+"_off.gif";
}	

// END NEW FUNCTIONS FOR NEW HEADER //


function popUp(URL,height,width) 
	{
	day = new Date();
	id = day.getTime();
	if ( height == null) height = 400;
	if ( width == null) width = 600;
	
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width="+width+",height="+height+",left = 100,top = 140');");
	};

function SetCookie(cookieName,cookieValue,nDays) 
	{
	 var today = new Date();
	 var expire = new Date();
	 if (nDays==null || nDays==0) nDays=1;
	 expire.setTime(today.getTime() + 3600000*24*nDays);
	 document.cookie = cookieName+"="+escape(cookieValue) + ";expires="+expire.toGMTString();
	 window.location.replace('http://www.almalasers.com/index.jsp');
	};
function deleteCookie(cookieName)
{
  var cookie_date = new Date ( );  // current date & time
  cookie_date.setTime ( cookie_date.getTime() - 1 );
  document.cookie = cookieName += "=; expires=" + cookie_date.toGMTString();
}


function IsPopupBlocker() {
var strNewURL = "Dummy.htm"
var Strfeature = "" ;
var WindowOpen = window.open
(strNewURL,"MainWindow",Strfeature);
try{
var obj = WindowOpen.name;
WindowOpen.close();
} 
catch(e){ 
alert("System has been blocked by POP-UP BLOCKER.\nPlease disable the POP-UP BLOCKER and try again\nor\nPlease contact your system administrator. ");
}
}

function video_Playback(action , videoURL, top_position)
	{
	alert();
	if (action == 0)
		{document.getElementById('video_window').style.display= 'none';}
	if (action == 1)
		{
		document.getElementById('video_window').style.top = top_position;
		video_align()
		document.getElementById('video_window').style.display= '';	
		content ='<table width="370" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" style="border: solid black 2px;" align="center">';
		content += '<tr>';
		content +=  '<td height="20">';
		content +=  '</td>';
		content +=  '</tr>';
		content +=  '<tr>';
		content +=  '<td align="center">';
		content +=  '<OBJECT ID="MediaPlayer1" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"  codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112" standby="Loading Microsoft� Windows� Media Player components..." type="application/x-oleobject">';
		content +=  '<PARAM NAME="AutoStart" VALUE="true" >';
		content +=  '<PARAM NAME="URL" id="URL" VALUE= "' + videoURL + '">';
		content +=  '<PARAM NAME="ShowControls" VALUE="True">';
		content +=  '<PARAM NAME="ShowStatusBar" VALUE="True">';
		content +=  '<EMBED id="test" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="'+ videoURL +'" name="MediaPlayer1" width=320 height=240 autostart="1" showcontrols="1" ShowStatusBar="1">';
		content +=  '</EMBED>';
		content +=  '</OBJECT>';
		content +=  '</td>';
		content +=  '</tr>';
		content +=  '<tr>';
		content +=  '<td height="10"></td>';
		content +=  '</tr>';
		content +=  '<tr>';
		content +=  '<td align="center">';
		content +=  '<a href="javascript:video_Playback(0);" class="more_link">CLOSE</a>';
		content +=  '</td>';
		content +=  '</tr>';
		content +=  '<tr>';
		content +=  '<td height="10">';
		content +=  '</td>';
		content +=  '</tr>';
		content +=  '</table>';
		document.getElementById('video_window').innerHTML = content ;

		}
	}
	
	


function image_Popup(action , imageURL, top)
	{
	if (action == 0)
		{document.getElementById('image_window').style.display= 'none';}
	if (action == 1)
		{
		document.getElementById('image_window').style.display= '';	
		document.getElementById('image_window').style.top = top;
		content ='<table width="500" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" style="border: solid black 2px;" align="center">';
		content += '<tr>';
		content +=  '<td height="10">';
		content +=  '</td>';
		content +=  '</tr>';
		content +=  '<tr>';
		content +=  '<td align="center">';
		content +=	'<img src="';
		content +=	imageURL;
		content +=	'" alt="" border="0" width="500">';
		content +=  '</td>';
		content +=  '</tr>';
		content +=  '<tr>';
		content +=  '<td height="10"></td>';
		content +=  '</tr>';
		content +=  '<tr>';
		content +=  '<td align="center">';
		content +=  '<a href="javascript:image_Popup(0);" class="more_link">CLOSE</a>';
		content +=  '</td>';
		content +=  '</tr>';
		content +=  '<tr>';
		content +=  '<td height="10">';
		content +=  '</td>';
		content +=  '</tr>';
		content +=  '</table>';
		document.getElementById('image_window').innerHTML = content ;
		}
	
	}
	
function clickhandler (e)
	{
		e = (e == null) ? event : e;
		var from = e.target ? e.target : e.srcElement; 

		if ((from.tagName == "IMG") && (from.className == "bad"))
			return false;
		return true;
	}

	function realign_Vendaria()
		{
		page_width = document.body.clientWidth;
		page_width = (page_width - 770)/2;
		document.getElementById('vendaria').style.left = -92 + page_width;
		}
	function video_align()
		{
		page_width = document.body.clientWidth;
		page_width = (page_width - 270)/2;
		document.getElementById('video_window').style.left = page_width + -53;
		}
