// JScript source code
// 		 ====== Logon from this site to call sgfs.apsx======================================================================
// 		 Comments:
// 			Three code-segments is needed if calling SGFS from a foreign-portal Iframe. 
// 			1. javascript function: SG_foreign()
// 			2. Calling SGFS switch button
// 			3. The SGFS Iframe with one default 0000_1.htm page
// 
// 			See the code below with number 1, 2 and 3
// 			If wishing the login protected by the "captcha image", tick the checkbox 
// 			in either user-preference or community preference
// 		 ===========================================================================

		function SG_foreign(){
			try{
				var o = document.getElementById("sg_iforeign");
				if(o){
					//var sdmn="http://www.stargarden.com/neopathtest/";
					//var sdmn="http://www.stargarden.com/sgfstest/";
					dummyDate=new Date(); 
					dummyParameter='&var=' + dummyDate.getTime();
					if(o.style.display=="none"){
						o.style.display="";
						//o.src=sdmn + "sgfs.aspx?" + dummyParameter;
					}else{
						//o.src="0000_1.htm?" + dummyParameter;
						o.style.display="none";
					}
				}
    } catch (err) { }
}

function SG_w(iframeid) {
    try {
        document.getElementById("sg_iforeign").style.display = "none";
    } catch (err) { }
}


/************************************************
Purpose: Switch on and off between the default iframe "sg_iframe" and the SGFS iframe "sgfs_iframe" 
SG_sgfsswitch("sgfs_iframe");
SG_sgfsswich("");

Iframe_ID:
sg_iframe:	 for stargarden pages
sgfs_iframe: for SGFS portal/pages
************************************************/
/* Support/Support and Maintenance.aspx */
function SG_support(xx) {
    try {
        var o2 = parent.document.getElementById("support");
        var o = parent.document.getElementById("www");
        o2.style.display = '';
        o.style.display = 'none';
   } catch (err) { }
}

function SG_www(iframeid) {
    try {
        //var sdmn = "http://localhost/";
        var o2 = parent.document.getElementById("support");
        var o = parent.document.getElementById("www");
        o.src = iframeid ;
        o.style.display = '';
        o2.style.display = 'none';
    } catch (err) { }
}
