
function EM_OpenWindow(url, name, h, w, full, res, scr, status, menu, tool, loc, dir, title)
{
	window.open(url, name, "height=" + h + ", width=" + w + ", directories=" + dir + ", location=" + loc + ", menubar=" + menu + ", resizable=" + res + ", scrollbars=" + scr + ", status=" + status + ", titlebar=" + title + ", toolbar=" + tool + ", fullscreen=" + full);
	
}

// JavaScript Document
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

//MM_preloadImages('images/nav/about_origene_on.gif','images/nav/cdna_clones_on.gif','images/nav/reagents_tools_on.gif','images/nav/sales_support_on.gif','images/nav/global_distribution_on.gif');

function getCookie(name) {
  var cookies = document.cookie;
  var start = cookies.indexOf(name + '=');
  if (start == -1) return null;
  var len = start + name.length + 1;
  var end = cookies.indexOf(';',len);
  if (end == -1) end = cookies.length;
  return unescape(cookies.substring(len,end));
}


function selectItem (item_no) {
  //If no session is found, set the action to 
  // /cdna/search/form_save.aspx
  if (getCookie("GUID") == null)
  {
  	document.ps2form.action = "/cdna/search/form_save.aspx";
  }
  
  document.ps2form.item_no.value = item_no;
  document.ps2form.submit();
}

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function show(object,e) {
    if (e != '') {
        if (document.all) {
            x = e.clientX;
            y = e.clientY;
        }
        if (document.layers) {
            x = e.pageX;
            y = e.pageY;
        }
    }

    if (document.layers && document.layers[object] != null) {
        document.layers[object].left = x;
        document.layers[object].top = y;
    }
    else if (document.all) {
		alert( document.all[object].style.posLeft);
        document.all[object].style.posLeft = x;
        document.all[object].style.posTop = y;
    }

    if (document.layers && document.layers[object] != null)
        document.layers[object].visibility = 'visible';
    else if (document.all)
        document.all[object].style.visibility = 'visible';
}

function hide(object) {
    if (document.layers && document.layers[object] != null)
        document.layers[object].visibility = 'hidden';
    else if (document.all)
        document.all[object].style.visibility = 'hidden';
}

function checkLoginForm () {
	var crLf = String.fromCharCode(13,10)
	var uid = document.TestForm.UserID.value
	var Pass_Word = document.TestForm.PassWord.value
	if (uid.length == 0 && Pass_Word.length < 6)  {
	 alert("User ID can not be blank."+ crLf +"Password must be at least 6 characters in length.")
	 return false
	 }
	if (uid.length == 0)  {
	 alert("User ID can not be blank.")
	 return false
	 }
	if (Pass_Word.length < 6)  {
	 alert("Password must be at least 6 characters in length.")
	 return false
	 }
	return true
}

//Begin dHTML Tooltip Timer
var tipTimer;
//End dHTML Tooltip Timer

function locateObject(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=locateObject(n,d.layers[i].document); return x;
}

function hideTooltip(object)
{
if (document.all)
{
	locateObject(object).style.display="block"
	locateObject(object).style.visibility="hidden"
	locateObject(object).style.left = 1;
	locateObject(object).style.top = 1;
return false
}
else if (document.layers)
{
	locateObject(object).display="block"
	locateObject(object).visibility="hide"
	locateObject(object).left = 1;
	locateObject(object).top = 1;
	return false
}
else
	return true
}

function showTooltip(object,e)
{
	//window.clearTimeout(tipTimer)
	var tipContent;
	locateObject(object).style.position = "absolute";
	locateObject(object).style.height = "10px";
	if (document.all)
		{
			locateObject(object).style.top=document.body.scrollTop+event.clientY+20
			
			//locateObject(object).innerHTML='<table style="font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 11px; border: '+bordercolor+'; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; background-color: '+backcolor+'" width="10" border="0" cellspacing="1" cellpadding="1"><tr><td nowrap><font style="font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 11px; color: '+textcolor+'">'+unescape(tipContent)+'</font></td></tr></table> '

			if ((e.x + locateObject(object).clientWidth) > (document.body.clientWidth + document.body.scrollLeft))
				{	
					locateObject(object).style.left = (document.body.clientWidth + document.body.scrollLeft) - locateObject(object).clientWidth-10;
				}
			else
			{
			locateObject(object).style.left=document.body.scrollLeft+event.clientX
			}
		locateObject(object).style.visibility="visible"
		locateObject(object).style.display="block"
		//tipTimer=window.setTimeout("hideTooltip('"+object+"')", displaytime);
		//window.setTimeout("hideTooltip('"+object+"')", displaytime);
		}
	else if (document.layers)
		{
		//locateObject(object).document.write('<table width="10" border="0" cellspacing="1" cellpadding="1"><tr bgcolor="'+bordercolor+'"><td><table width="10" border="0" cellspacing="0" cellpadding="2"><tr bgcolor="'+backcolor+'"><td nowrap><font style="font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 11px; color: '+textcolor+'">'+unescape(tipContent)+'</font></td></tr></table><td></tr></table>')
		locateObject(object).document.close()
		locateObject(object).top=e.y+20

		if ((e.x + locateObject(object).clip.width) > (window.pageXOffset + window.innerWidth))
			{
				locateObject(object).left = window.innerWidth - locateObject(object).clip.width-10;
			}
		else
			{
			locateObject(object).left=e.x;
			}
		locateObject(object).visibility="show"
		locateObject(object).display="block"
		//tipTimer=window.setTimeout("hideTooltip('"+object+"')", displaytime);
		//window.setTimeout("hideTooltip('"+object+"')", displaytime);
	}
	else
	{
		return true
	}
}