


String.prototype.trim = function()
{
    return this.replace(/(^\s*)|(\s*$)/g, "");
}


function WinGo(argURL) {
	document.location.href=argURL;
}
function WinGo2(argURL) {
	top.location.href=argURL;
}

function ViewModeless(argURL,argW,argH,argArguments) {
	var _x = document.body.clientWidth/2  - 200;
	var _y = document.body.clientHeight/2 - 100;		
	showModelessDialog(argURL, argArguments,"font-family:Verdana; font-size:12; dialogWidth:"+argW+"px; dialogHeight:"+argH+"px; dialogLeft:" + _x + "px; dialogTop:" + _y + "; status:no; help:no; scroll:yes");
}


function ViewModelessNoScroll(argURL,argW,argH,argArguments) {
	var _x = document.body.clientWidth/2  - 200;
	var _y = document.body.clientHeight/2 - 100;		
	showModalDialog(argURL, argArguments,"font-family:Verdana; font-size:12; dialogWidth:"+argW+"px; dialogHeight:"+argH+"px; dialogLeft:" + _x + "px; dialogTop:" + _y + "; status:no; help:no; scroll:no");
}


function CommonModeless(argURL,argX,argY,argW,argH,argArguments) {	
	showModelessDialog(argURL, argArguments,"font-family:Verdana; font-size:12; dialogWidth:"+argW+"px; dialogHeight:"+argH+"px; dialogLeft:" + argX + "px; dialogTop:" + argY + "; status:no; help:no; scroll:no");
}

// ÅõÇ¥¿ë
function ViewPopModeless(argURL,argW,argH,argArguments) {
	var _x = document.body.clientWidth/2  - 700;
	var _y = document.body.clientHeight/2 - 400;		
	showModelessDialog(argURL, argArguments,"font-family:Verdana; font-size:12; dialogWidth:"+argW+"px; dialogHeight:"+argH+"px; dialogLeft:" + _x + "px; dialogTop:" + _y + "; status:no; help:no; scroll:yes");
}

function ViewPollModeless(argURL,argW,argH,argArguments) {
	var _x = document.body.clientWidth/2  - 300;
	var _y = document.body.clientHeight/2 - 300;		
	var return_arg = showModelessDialog(argURL, argArguments,"font-family:Verdana; font-size:12; dialogWidth:"+argW+"px; dialogHeight:"+argH+"px; dialogLeft:" + _x + "px; dialogTop:" + _y + "; status:no; help:no; scroll:no");
	//return_arg;
}

function ViewReturnModeless(argURL,argW,argH,argArguments) {
	var _x = document.body.clientWidth/2  - 300;
	var _y = document.body.clientHeight/2 - 300;	
	fraPoll.location.href=argURL;
	//var return_arg = showModelessDialog(argURL, argArguments,"font-family:Verdana; font-size:12; dialogWidth:"+argW+"px; dialogHeight:"+argH+"px; dialogLeft:" + _x + "px; dialogTop:" + _y + "; status:no; help:no; scroll:no");

}

function ViewResultModeless(argURL,argW,argH,argArguments) {
	var _x = document.body.clientWidth/2  - 300;
	var _y = document.body.clientHeight/2 - 300;	
	//fraPoll.location.href=argURL;
	showModelessDialog(argURL, argArguments,"font-family:Verdana; font-size:12; dialogWidth:"+argW+"px; dialogHeight:"+argH+"px; dialogLeft:" + _x + "px; dialogTop:" + _y + "; status:no; help:no; scroll:no");

}
// ÅõÇ¥¿ë ³¡


function ChkRadio(obj) {
	var i;
	var chk=false
			
	for (i=0; i<obj.length; i++) {
		if (obj[i].checked) {
			chk = true;
			break;
		}
	}
	return chk;		
}


//style="cursor:hand" onClick="opnBigImg(this);"
function opnBigImg(obj) {
	var oPopup = window.createPopup();
    var oPopBody = oPopup.document.body;
	    
	var _x = document.body.clientWidth/2  - 200;
	var _y = document.body.clientHeight/2 - 100;	
	    
    oPopBody.style.backgroundColor = "lightyellow";
    oPopBody.style.border = "solid black 1px";
    oPopBody.innerHTML = "<img src='" + obj.src + "' width=320 height=240 >";
    oPopup.show( _x, _y, 320, 240, document.body);
}


function opnFullBigImg(obj) {
	var oPopup = window.createPopup();
    var oPopBody = oPopup.document.body;
	    
	//var _x = document.body.clientWidth/2  - 200;
	//var _y = document.body.clientHeight/2 - 100;	
	
	_x = 50;
	_y = 50;
	    
    oPopBody.style.backgroundColor = "lightyellow";
    oPopBody.style.border = "solid black 1px";
    oPopBody.innerHTML = "<img src='" + obj.src + "'>";
    oPopup.show( _x, _y, obj.width, obj.height, document.body);
}



function TopShowFlash(argSWF) {
	var strTopFlash;
	strTopFlash = "<div id='Layer1' style='position:absolute; left:8px; top:21px; width:790px; height:114px; z-index:2'>"
	strTopFlash = strTopFlash + "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'  codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='790' height='114' id=ShockwaveFlash1>"
	strTopFlash = strTopFlash + "    <param name='movie' value='" + argSWF + "'>"
	strTopFlash = strTopFlash + "    <param name='quality' value='high'>"
	strTopFlash = strTopFlash + "    <param name=wmode value=transparent>"
	strTopFlash = strTopFlash + "   <embed src='" + argSWF + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='790' height='114'></embed></object>"
	strTopFlash = strTopFlash + "</div>"; 
	document.writeln(strTopFlash);
}


function ShowFlash(argSWF,argW,argH) {
    var obj = "flash1";
    document.write ('<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="'+argW+'" HEIGHT="'+argH+'" id="'+obj+'" ALIGN="">');
    document.write ('<PARAM NAME="movie" VALUE="'+argSWF+'">');
    document.write ('<PARAM NAME="wmode" VALUE="transparent">');
    document.write ('<param name="allowScriptAccess" value="always">');
    document.write ('<PARAM NAME="quality" VALUE="high">');
    document.write ('<PARAM NAME="menu" VALUE="false">');
    document.write ('<PARAM NAME="bgcolor" VALUE="#FFFFFF">');
    document.write ('<PARAM NAME="'+obj+'" value="false">');
    document.write ('<EMBED src="'+argSWF+'" quality=high menu=false bgcolor=#FFFFFF  WIDTH="'+argW+'" HEIGHT="'+argH+'" NAME="'+obj+'" ALIGN="" TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" allowScriptAccess="always">');
    document.write ('</EMBED>');
    document.write ('</OBJECT>');
//	var strTopFlash;
//	strTopFlash = "";
//	strTopFlash = strTopFlash + "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'  codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' width='" + argW + "' height='" + argH + "' id=ShockwaveFlash1>"
//	strTopFlash = strTopFlash + "    <param name='movie' value='" + argSWF + "'>"
//	strTopFlash = strTopFlash + "    <param name='quality' value='high'>"
//	strTopFlash = strTopFlash + "    <param name=wmode value=transparent>"
//	strTopFlash = strTopFlash + "   <embed src='" + argSWF + "' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='" + argH + "' height='" + argH + "'></embed></object>"
//	document.writeln(strTopFlash);
}

