﻿var http_request = false;
function send_request(url) {
http_request = false;
if(window.XMLHttpRequest) { //Mozilla 
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {//MiME
http_request.overrideMimeType('text/xml');
}
}
else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
window.alert("Can't create XMLHttpRequest instance.");
return false;
}
http_request.onreadystatechange = processRequest;
http_request.open("GET", url, true);
http_request.send(null);
}

    function processRequest() {
    	
        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
            	;;
            } else {
              ;;
            }
        }
    }

String.prototype.trim=function(){
return this.replace(/(^\s*)|(\s*$)/g, "");
}

function errHandle(strurl)
{
    if(strurl.indexOf("vgnextrefresh=1")<0)
    {
      if(strurl.indexOf("?")<0)
      {
        window.location.replace(strurl+"?vgnextrefresh=1");
      }
      else
      {
        window.location.replace(strurl+"&vgnextrefresh=1");
      }
    }
    else
    {
    	var nexturl="/ww/404.jsp?locale="+locale+"&lsturl="+window.location.href;
		/*
    	if(strurl.indexOf("www.seagate")>=0)
    	{
      	window.location.replace(nexturl);
    	}
    	else
    	{*/
      	document.write("<div class='text'>There currently is no content for this page! Please try again later.</div>");
      	send_request(nexturl);
  			//window.open("/ww/404.jsp?locale=en-US","newwindow","scrollbars=yes,top=40,left=200,resizable=yes,menubar=yes,width=30,height=30");
  		//}
    }
  return false;
}

function emptyHandle(conid)
{
		var str=document.getElementById(conid).innerHTML.trim();
    if(str.length<1)
    {
    	var strurl=window.location.href;
    	if(strurl.indexOf("vgnextrefresh=1")<0)
    	{
      	if(strurl.indexOf("?")<0)
      	{
        	window.location.replace(strurl+"?vgnextrefresh=1");
      	}
      	else
      	{
        	window.location.replace(strurl+"&vgnextrefresh=1");
      	}
    	}
    	else
    	{
    			var nexturl="/ww/404.jsp?locale="+locale+"&lsturl="+window.location.href;
    			if(strurl.indexOf("www.seagate")>=0)
    			{
    				window.location.replace(nexturl);
    			}
    			else
    			{
    				document.write("<div class='text'>There currently is no content for this page. Please try again later.</div>");
    			}
    	}
    }
  	return false;
}

function emptyHandle2(conid1,conid2)
{
		var str1=document.getElementById(conid1).innerHTML.trim();
		var str2=document.getElementById(conid2).innerHTML.trim();
    if(str1.length<1 && str2.length<1)
    {
    	var strurl=window.location.href;
    	if(strurl.indexOf("vgnextrefresh=1")<0)
    	{
      	if(strurl.indexOf("?")<0)
      	{
        	window.location.replace(strurl+"?vgnextrefresh=1");
      	}
      	else
      	{
        	window.location.replace(strurl+"&vgnextrefresh=1");
      	}
    	}
    	else
    	{
    			var nexturl="/ww/404.jsp?locale="+locale+"&lsturl="+window.location.href;
    			if(strurl.indexOf("www.seagate")>=0)
    			{
    				window.location.replace(nexturl);
    			}
    			else
    			{
    				document.write("<div class='text'>There currently is no content for this page. Please try again later.</div>");
    			}
    	}
    }
  	return false;
}