	function AttachEvent(obj,evt,fnc,useCapture){
		if (!useCapture) useCapture=false;
		if (obj.addEventListener){
			obj.addEventListener(evt,fnc,useCapture);
			return true;
		} else if (obj.attachEvent) return obj.attachEvent("on"+evt,fnc);
		else{
			MyAttachEvent(obj,evt,fnc);
			obj['on'+evt]=function(){ MyFireEvent(obj,evt) };
		}
	} 

	function MyAttachEvent(obj,evt,fnc){
		if (!obj.myEvents) obj.myEvents={};
		if (!obj.myEvents[evt]) obj.myEvents[evt]=[];
		var evts = obj.myEvents[evt];
		evts[evts.length]=fnc;
	}
	function MyFireEvent(obj,evt){
		if (!obj || !obj.myEvents || !obj.myEvents[evt]) return;
		var evts = obj.myEvents[evt];
		for (var i=0,len=evts.length;i<len;i++) evts[i]();
	}

	function removeAllOptions(selectbox)
	{
		var i;
		for(i=selectbox.options.length-1;i>=0;i--)
		{
			selectbox.remove(i);
		}
	}


	function removeOptions(selectbox)
	{
		var i;
		for(i=selectbox.options.length-1;i>=0;i--)
		{
			if(selectbox.options[i].selected)
				selectbox.remove(i);
		}
	}


	function addOption(selectbox,value,text )
	{
		var optn = document.createElement("OPTION");
		optn.text = text;
		optn.value = value;
		selectbox.options.add(optn);
	}


	function hideSelect(theSelect) {
	  if (document.all) {
		theSelect.style.visibility='hidden'; }
	  else {
	    if(navigator.userAgent.indexOf("Gecko")!=-1) {// is NS6 ?
	      theSelect.style.visibility='hidden'; }
	    else {
	    	theSelect.visibility='hide'; }
	  }
	}


function popUpLargeImage(imgName) {
	var img = document.getElementsByName(imgName)[0];

	var newImg = new Image();
	newImg.src = img.src.replace('medium','large');
	var height = newImg.height;
	var width = newImg.width;

        var url = '/popup.aspx?psrc='+ encodeURIComponent(img.src);
        var name = 'LargeImage';
        var resizable = 'no';
        var params = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + resizable + ',resizable=' + resizable + ',copyhistory=no,width=' + width + ',height=' + height + 'left=0,top=0';
        window.open(url.replace('medium','large'), name, params);
}


function popupsizingcharts(url) {
	var newWindow=window.open(url,'size','toolbar=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=640');
	newWindow.focus();
	return false;
}


function popUpSocial(url) {
	newwindow=window.open(url,'name','width=900,height=600,resizable=yes,scrollbars=yes,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes');
	if (window.focus) {newwindow.focus()}
}

function popUpBongo(url) {
newwindow=window.open(url,'name','width=900,height=550,resizable=yes,scrollbars=yes,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes');
	if (window.focus) {newwindow.focus()}
}
