
function openPopup(url, name) 
{
   popupWin = window.open(url, name, 'scrollbars,resizable,width=480,height=320,modal=yes,alwaysRaised=yes');
}

function openPopupWide(url, name) 
{
   popupWin = window.open(url, name, 'scrollbars,resizable,width=640,height=420,modal=yes,alwaysRaised=yes');
}

function openPopupImg(url, name) 
{
   popupWin = window.open(url, name, 'scrollbars,resizable,width=850,height=700,modal=yes,alwaysRaised=yes');
}


function CheckInputFields(input)
{
    var InputField   = new Array("username","email");
    var AlertMsg     = new Array("Please enter your User Name!", "Please enter your Email address!");
    var AlertTxt     = "";

    for(var Num=0; Num < InputField.length; Num++) 
    {
        var s1=input.elements[InputField[Num]].value;
        if ((s1 == "") || (s1 == " ") || (s1 == "  ") || (s1 == "   ")) 
        {
            AlertTxt="\n\n"+AlertMsg[Num]+"\t\n\n";
            break;
        }
    }

    if (AlertTxt == "") return true;

    alert(AlertTxt);
    return false;
}

function SetRefererCookie(REFERER)
{
  var _date    = new Date("January 1, 2014");
  var _expires = "expires=" + _date.toGMTString();
  var _domain  = "domain="  + "pantaray.com";
  var _referer = "referer=" + REFERER;
  var _cookie  = _referer + ";" + _expires + ";" + _domain;

  document.cookie = _cookie;
//  alert (_cookie);
}


function _OpenRefererCGI(product, name) 
{
  url="http://www.pantaray.com/cgi/referer.cgi?product=" + product;
  popupWin = window.open(url, name, 'scrollbars,resizable,width=100,height=100,modal=yes,alwaysRaised=yes');
}


function swapImage(image,action)
{
	var object = document.getElementById(image);
	var imagePath = object.src;
			
	if (action == "on")
	{
		imagePath = imagePath.replace(".gif","-on.gif");
		object.src = imagePath;
	}
	else
	{
		imagePath = imagePath.replace("-on","");
		object.src = imagePath;
	}
			
}
