<!--
var homeimg = new Array(5);
var totrandomnum = 18;
var thishomeimg;
var thisrandomnum;
var thisAd = 0;
var url = new Array();
var mainImg;
var mainImgOilGas;

//Home images:
// (Train) 'Access data 7x faster than you've ever imaginged'
url[1] = "performance.html";
// (IT Lady) 'Simply manage a virtually boundless storage cluster'
url[2] = "manageability.html";
// (Turbo Button) ' Unlock the potential of your Linux cluster'
url[3] = "products.html";
// (Skyscraper) 'Your Linux cluster just met it's match'
url[4] = "solutions.html";
// (Oil & Gas) 'Panasas Fuels Oil and Gas'
url[5] = "oilgas.html";

if (document.images) {
     for (var i = 0; i < homeimg.length; i++) {
          homeimg[i] = new Image();
          homeimg[i].src = "images/homeimg" + (i + 1) + ".jpg";
          mainImg = new Image();
          mainImg.src = "images/home_text.gif";
          mainImgOilGas = new Image();
          mainImgOilGas.src = "images/home_text_oilgas.gif";
     }
}

function rotatehomeimg() {
     if (document.images) {
		if (document.randomhomeimg.complete){
               thisrandomnum = Math.round((totrandomnum) * Math.random());

	           document.hometextimg.src = mainImg.src;

			   if (thisrandomnum < 2) {
			   		thishomeimg = 1;
			   } else if (thisrandomnum == 2) {
			   		thishomeimg = 2;
			   } else if (thisrandomnum == 3) {
			   		thishomeimg = 3; 
			   } else if (thisrandomnum > 3 && thisrandomnum < 5) {
			   		thishomeimg = 4; 
			   } else {
			   		thishomeimg = 5;
		            document.hometextimg.src = mainImgOilGas.src;
			   }
//			   alert('thisrandomnum= '+thisrandomnum+' thishomeimg= '+thishomeimg);
               document.randomhomeimg.src = homeimg[thishomeimg-1].src;

		}
    }
}


function jumpHomeImgURL() {
//	 thishomeimg = thishomeimg + 1;
     location.href = url[thishomeimg];
}


if (document.images) {
     var btn_flashdemo_a = new Image();
     btn_flashdemo_a.src = "images/btn_flashdemo_a.gif";
     var btn_flashdemo = new Image();
     btn_flashdemo.src = "images/btn_flashdemo.gif";

     var btn_configsystem_a = new Image();
     btn_configsystem_a.src = "images/btn_configsystem_a.gif";
     var btn_configsystem = new Image();
     btn_configsystem.src = "images/btn_configsystem.gif";

}

function imgOn(imgName) {
     if (document.images) {
          document.images[imgName].src = eval(imgName + "_a").src;
     }
}

function imgOff(imgName) {
     if (document.images) {
          document.images[imgName].src = eval(imgName).src;
     }
}

function flashDemoWindow(url) { 
fwindow=window.open(url,"flashdemo",'height=580,width=770,resizable=no,scrollbars=no');
fwindow.focus();
}

function configWindow() { 
hwindow=window.open("http://www.panasas.com/panconfigurator/config.php","configurator",'height=610,width=600,resizable=no,scrollbars=no');
hwindow.focus();
}

function configWindowOnlinePurch() { 
//hwindow=window.open("coming_soon.html","configuratoronlinepurch",'height=300,width=600,resizable=no,scrollbars=no');
hwindow=window.open("../panconfiguratoronlinepurch/panasas_results3.php","configuratoronlinepurch",'height=610,width=600,resizable=no,scrollbars=no');
hwindow.focus();
}

function popup1Window(url,winName) {
pwindow=window.open(url,winName,'height=500,width=600,resizable=no,scrollbars=yes');
pwindow.focus();
}

function popup2Window(url,winName) {
pwindow=window.open(url,winName,'height=500,width=600,resizable=yes,scrollbars=yes');
pwindow.focus();
}


function checkCookieExist(docName) {
		var now = new Date();
		// fix the bug in Navigator 2.0, Macintosh
		fixDate(now);
		// cookie expires in one year (actually, 365 days)
		// 365 days in a year
		// 24 hours in a day
		// 60 minutes in an hour
		// 60 seconds in a minute
		// 1000 milliseconds in a second
		now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
	
		var visitstrial = getCookie("panasaslibrary");
		
		//doc URLs		
		if (docName == 'PanasasCorpBrochure' ) { 
			var docUrl = "docs/Panasas_Corp_Brochure.pdf"; }

		if (docName == 'ObjectStorageArchitectureWP' ) { 
			var docUrl = "docs/Object_Storage_Architecture_WP.pdf"; }

		if (docName == 'SharedStorageWP' ) { 
			var docUrl = "docs/Shared_Storage_WP.pdf"; }

		if (docName == 'PanasasActiveScaleDS' ) { 
			var docUrl = "docs/Panasas_ActiveScale_DS.pdf"; }

		if (docName == 'PanasasBladesDS' ) { 
			var docUrl = "docs/Panasas_Blades_DS.pdf"; }

		if (docName == 'PanasasSwitchShelfDS' ) { 
			var docUrl = "docs/Panasas_SwitchShelf_DS.pdf"; }

		if (docName == 'PanasasPanActiveMgrDS' ) { 
			var docUrl = "docs/Panasas_PanActive_Mgr_DS.pdf"; }

		if (docName == 'PanActiveSupportDS' ) { 
			var docUrl = "docs/PanActive_Support_DS.pdf"; }

		if (docName == '2PagerBrochuremediasheetweb' ) { 
			var docUrl = "docs/2PagerBrochure_mediasheet_web.pdf"; }

		if (docName == 'PanasasSpecificationsSheet' ) { 
			var docUrl = "docs/Panasas_Specifications_Sheet.pdf"; }

		if (docName == 'PerformanceBackgrounder' ) { 
			var docUrl = "Performance_Backgrounder.pdf"; }

		if (docName == 'ActiveStor_Datasheet' ) { 
			var docUrl = "ActiveStor_Datasheet_FINAL.pdf"; }

		if (docName == 'ActiveScale3_Datasheet' ) { 
			var docUrl = "ActiveScale3_Datasheet_FINAL.pdf"; }

		if (docName == 'PredictiveSelfManagement' ) { 
			var docUrl = "Predictive_Self-Mgmt_WP.pdf"; }

		// if the cookie trial wasn't found, this is your first visit
		if (!visitstrial) {
		  visitstrial = 1; // the value for the new cookie
		  popupRegWindow('registration_popup.html','registration');
		} else {
		  // increment the counter
		  visitstrial = parseInt(visitstrial) + 1;
		  popup2Window(docUrl,docName);
		}
}

function popupRegWindow(url,winName) {
pwindow=window.open(url,winName,'height=650,width=600,resizable=no,scrollbars=yes');
pwindow.focus();
}

function selectPhoto(picNum) {
		document.myPicture.src = "images/" + myPix[picNum];
}

// COOKIE SCRIPT ****************

// name - name of the cookie
// value - value of the cookie
// [expires] - expiration date of the cookie (defaults to end of current session)
// [path] - path for which the cookie is valid (defaults to path of calling document)
// [domain] - domain for which the cookie is valid (defaults to domain of calling document)
// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// * an argument defaults when it is assigned null as a placeholder
// * a null placeholder is not required for trailing omitted arguments
function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
}

// name - name of the desired cookie
// * return string containing value of specified cookie or null if cookie does not exist
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));
}

// name - name of the cookie
// [path] - path of the cookie (must be same as path used to create cookie)
// [domain] - domain of the cookie (must be same as domain used to create cookie)
// * path and domain default if assigned null or omitted if no explicit argument proceeds
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";
  }
}

// date - any instance of the Date object
// * hand all instances of the Date object to this function for "repairs"
function fixDate(date) {
  var base = new Date(0);
  var skew = base.getTime();
  if (skew > 0)
    date.setTime(date.getTime() - skew);
}


//***** Navigation Rollover Codes (start) *****

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_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}

//***** Navigation Rollover Codes (end) *****



//-->
