function setBaseRef ( ) { var argc = arguments. length; var baseRef = ""; var targetDomain; if ( argc < 1 || argc > 2 ) alert ( "Invalid arg count for setBaseRef(). " + "Please notify Webmaster." ); if ( argc == 0 ) targetDomain = window. location. host else { targetDomain = arguments [0]; if ( argc > 2 ) argc = 2 } if ( window. location. host != targetDomain ) { if ( window. location. protocol ) baseRef = window. location. protocol + "//"; baseRef += targetDomain; if ( window. location. port ) { baseRef += ":"; baseRef += window. location. port } if ( argc <= 1 ) baseRef += "/" else baseRef += arguments [1]; document. writeln ( '' ) } }