function $() {
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1) 
      return element;

    elements.push(element);
  }

  return elements;
}
function getWindowHeight() {
	if (window.self && self.innerHeight) {
		return self.innerHeight;
	}
	if (document.documentElement && document.documentElement.clientHeight) {
		return document.documentElement.clientHeight;
	}
	return 0;
}
function getWindowWidth() {
	if (window.self && self.innerWidth) {
		return self.innerWidth;
	}
	if (document.documentElement && document.documentElement.clientWidth) {
		return document.documentElement.clientWidth;
	}
	return 0;
}
function iframeResize()
{
	var dyniframe   = null;
	var indexwin    = null;

	if (document.getElementById)
	{
		dyniframe       = document.getElementById("content");
		indexwin        = window;

		if (dyniframe)
		{
		    
			if (dyniframe.contentDocument)
			{
				dyniframe.height = dyniframe.contentDocument.body.scrollHeight + 20;
			}
			else if (dyniframe.document && dyniframe.document.body.scrollHeight)
			{
			    
				var iheight	= content.document.body.scrollHeight + 0;
				//
				//alert(iheight);
				if(iheight>400){
					dyniframe.height = iheight+"px";
				}
			}
			
		}
	}
}
function classResizeApp(){
	var h = getWindowHeight()-54;
	var w = getWindowWidth();
	document.getElementById("optionMap_iframe").style.height = h+"px";
	document.getElementById("optionMap_iframe").style.width = w+"px";;
	//alert(optionMap_iframe.document.getElementById("referenceiframeflash").style.width);
	if(window.frames["optionMap_iframe"].document.getElementById('flashMapApi-Menu').style.display!="none"){
		var w1 = w-293;var h1=h-28;
		if(this_url[1]=="flash"){
			window.frames["optionMap_iframe"].document.getElementById("referenceiframeflash").width=w1+"px";
			window.frames["optionMap_iframe"].document.getElementById("referenceiframeflash").height=h1+"px";
		}
		if(this_url[1]=="ajax"){
			window.frames["optionMap_iframe"].document.getElementById("reference_iframeAjax").width=w1+"px";
			window.frames["optionMap_iframe"].document.getElementById("reference_iframeAjax").height=h1+"px";	
		}
	}else{
		var w2=w-293;var h2=h-28;
		window.frames["optionMap_iframe"].document.getElementById("referenceiframeFlex").width=w2+"px";
		window.frames["optionMap_iframe"].document.getElementById("referenceiframeFlex").height=h2+"px";
	}
	var w3=w-293;var h3=h-8;
	window.frames["optionMap_iframe"].document.getElementById("code_iframe").width=w3+"px";
	window.frames["optionMap_iframe"].document.getElementById("code_iframe").height=h3+"px";
}
/**
	 //ÅÐ¶Ïä¯ÀÀÆ÷ÀàÐÍ£¨IE£©
**/
function MMAPIsIE() {
	return navigator.appName == "Microsoft Internet Explorer";
}
/**
 //ÅÐ¶Ïä¯ÀÀÆ÷ÀàÐÍ£¨Firefox£©
**/
function MMAPIsFirefox() {
	return navigator.userAgent.indexOf("Firefox") > 0;
}
function referenceResizeApp(){
	var bodyHeight  = getWindowHeight();
	if( bodyHeight - 352 > 0){
		try{
		document.getElementById("flashResult_bot").style.height = bodyHeight - 302 + "px" ;
		document.getElementById("ajaxResult_bot").style.height = bodyHeight - 302 + "px" ;
		document.getElementById("flexResult_bot").style.height = bodyHeight - 302 + "px" ;
		}catch(ex){}
	}
	var h = getWindowHeight()-103;
	var w = getWindowWidth()-293;
	document.getElementById("reference_iframePage").style.height = h+"px";
	document.getElementById("reference_iframePage").style.width = w+"px";
}
