/******************************************************************************

* general.js                                                                  *

*                                                                             *

* Copyright 2002 by Miki Karakisawa. only for Swiss Site                      *

* Email address: swiss@pmex.co.jp                                             *

* Last update: Dec. 26, 2002.                                                 *

*                                                                             *

* Provides basic functions for DHTML positioned elements which will work on   *

* both Netscape Communicator and Internet Explorer browsers (version 4.0 and  *

* up).                                                                        *

******************************************************************************/







// Determine browser.



var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 &&

                parseFloat(navigator.appVersion) >= 4) ? 1 : 0;

var isMinIE4 = (document.all) ? 1 : 0;

var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.") >= 0) ? 1 : 0;





// 





if (document.images) {

  image1on = new Image();

  image1on.src = "/html/img/bar22.gif";

  

  image1off = new Image();

  image1off.src = "/html/img/bar11.gif";



}



function changeImages() {

  if (document.images) {

    for (var i=0; i<changeImages.arguments.length; i+=2) {

      document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");

    }

  }

}





function loadBottomFrame() {

	if (top != self) {

		window.frames.parent.bottom.location.reload();

	}

}



function loadTopFrame() {

	if (top != self) {

		window.frames.parent.top.location.reload();

	}

}





function checkselect(in1, in2) {

	var isOK = false;

	var da_string= 'document.'+in1+'.'+in2+'.selectedIndex'

	var ex=eval(da_string);

	var why='document.'+in1+'.'+in2+'['+ex+'].selected=true'

	var str2='document.'+in1+'.'+in2+'['+ex+'].value'

	var cuz=eval(str2)

	if (cuz == ''){

		isOK=false;

		var why='document.'+in1+'.'+in2+'[0].selected=true';

		eval(why);

	}	

	else {

		isOK=true;

	}

	return isOK;

}





 function isEmail(string) {

    if (!string) return false;

    var iChars = "*|,\":<>[]{}`\';()&$#%";



    for (var i = 0; i < string.length; i++) {

       if (iChars.indexOf(string.charAt(i)) != -1)

          return false;

    }

    return true;

 }                      



 function isReady(thing) {

     if (isEmail(thing.gfp_13_email.value) == false) {

         alert("Please enter a valid email address.");

         thing.gfp_13_email.focus();

         return false;

     }

	var foo = thing.gfp_01_contact_method[1].checked; // 0/1/2 = email/call/send -  therefore 1= user requested phone contact

	if (foo) {

		if (thing.gfp_23_phone.value == ""){

			alert("In order to contact you by phone, please enter a telephone number, and ideally a preferred contact time in the message box");

			thing.gfp_23_phone.focus();

			return false;

		}

	}

    return true;

 }





function openWin (URL,Wid,Hei) {

	aWindow = window.open(URL,"OpenWindow",

        'toolbar=no,location=no,status=no,scrollbars=yes,resizable=no,menubar=no,left=50,top=100,width=' + openWin.arguments[1] +

        ',height=' + openWin.arguments[2]);

}

function openWin2 (URL,Wid,Hei) {

	aWindow = window.open(URL,"OpenWin",

        'toolbar=no,location=no,status=no,scrollbars=yes,resizable=no,menubar=no,left=50,top=100,width=' + openWin2.arguments[1] +

        ',height=' + openWin2.arguments[2]);

}

function openWinToolbar (URL,Wid,Hei) {

     aWindow = window.open(URL,"_blank",

        'toolbar=yes,status=no,scrollbars=yes,resizable=yes,menubar=no,width=' + openWinToolbar.arguments[1] +

        ',height=' + openWinToolbar.arguments[2]);

}



function openWinTravelfrom (URL,Wid,Hei) {

     aWindow = window.open(URL,"OpenWin",

        'toolbar=no,status=no,scrollbars=no,resizable=no,menubar=no,width=300,height=200');

}





