function Minimize()
{
	var MItem1=document.getElementById('Thoitiet');
	var MItem2=document.getElementById('Giavang');
	var MItem3=document.getElementById('ttcb');
	var MItem4=document.getElementById('Ngoaite');
	MItem1.style.display='none';
	MItem2.style.display='none';
	MItem3.style.display='none';
	MItem4.style.display='none';
	nap();
}
function ItemMinimize(Name)
{
	var MItem=document.getElementById(Name);
	
	if (MItem.style.display!='')
	{
		//MItem.setAttribute('style','display:""');
		MItem.style.display='';
		
	}
	else
	{
		//MItem.setAttribute('style','display:none');
		MItem.style.display='none';
		
	}
}

function embed_flash(swf_card, swf_width, swf_height, id){
	var str = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" ';
		if (swf_width != '') 
			str += 'WIDTH='+swf_width+' ';
		if(swf_height != '')
			str += 'HEIGHT='+swf_height+' ';
		str += 'id="'+id+'">';
		str += '<PARAM NAME=movie VALUE="'+swf_card+'">';
		str += '<PARAM NAME=quality VALUE=high>';
		str += '<PARAM NAME=wmode VALUE="Transparent">';
		str += '<PARAM NAME=bgcolor VALUE="">';
		str += '<PARAM NAME=menu VALUE=false>';
		str += '<EMBED style="CURSOR: hand" src="'+swf_card+'" quality=high ';
		if (swf_width != '') 
			str += 'WIDTH='+swf_width+' ';
		if(swf_height != '')
			str += 'HEIGHT='+swf_height+' ';
		str += 'bgcolor="" menu=false wmode=Transparent TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">';
		str += '</embed>';
		str += '</object>';
	document.write(str);
}

function OnCmdSubmitClick(LocationRequest, nameRad, Width, Height)
{
	var chasm = screen.availWidth;
	var mount = screen.availHeight;
	var bIsChecked = false;
	var r = document.getElementsByName(nameRad);
		for(i=0;i<r.length;i++)
		{
			if( r[i].checked )
			{
			window.open('/UserControls/Poll/default.aspx?results='+ r[i].value +'&LID='+LocationRequest,'Poll','left='+ (chasm - Width - 10)* .5+',top='+(mount - Height - 30)* .5+',width='+ Width +',height='+ Height +',toolbar=1,resizable=0');
			bIsChecked = true;
			break;
			}
		}
	if(!bIsChecked ) alert("Hãy ch?n ít nh?t m?t m?c d? bình ch?n!");
	return bIsChecked;
}

function OnCmdViewClick(LocationRequest, Width, Height)
{
	var chasm = screen.availWidth;
	var mount = screen.availHeight;
	window.open('/UserControls/Poll/default.aspx?results=-1&LID='+LocationRequest,'Poll','locationbar=no,left='+ (chasm - Width - 10)* .5+',top='+(mount - Height - 30)* .5+',width='+ Width +',height='+ Height +',toolbar=1,resizable=0');
}




//

//end Scroll
PositionX = 100;
PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=500,height=500,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
	if (isNN){imgWin=window.open('about:blank','',optNN);}
	if (isIE){imgWin=window.open('about:blank','',optIE);}
	with (imgWin.document){
		writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');
		writeln('<sc'+'ript>');
		writeln('var isNN,isIE;');
		writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
		writeln('isNN=(navigator.appName=="Netscape")?1:0;');
		writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
		writeln('function reSizeToImage(){');
		writeln('if (isIE){');
		writeln('temp=navigator.appVersion.split("MSIE"); version=parseFloat(temp[1])');
		writeln('if (version>=7.0){ window.resizeTo(250,250); height=250-(document.body.clientHeight-document.images[0].height);');
		writeln('width=250-(document.body.clientWidth-document.images[0].width);}');
		writeln('else{ window.resizeTo(100,100); height=100-(document.body.clientHeight-document.images[0].height);');
		writeln('width=100-(document.body.clientWidth-document.images[0].width);}');
		writeln('window.resizeTo(width,height);}');
		writeln('if (isNN){');       
		writeln('window.innerWidth=document.images["George"].width;');
		writeln('window.innerHeight=document.images["George"].height;}}');
		writeln('function doTitle(){document.title="'+imageTitle+'";}');
		writeln('</sc'+'ript>');
		if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
		else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
		writeln('<a href="" onClick="window.close(); return false;"><img align=center name="George" alt="?óng l?i" src='+imageURL+' border="0" style="display:block"></a></body></html>');
		close();		
	}
}
/*function OnCmdSubmitClick(LocationRequest, nameRad, Width, Height)
{
	var chasm = screen.availWidth;
	var mount = screen.availHeight;
	window.open('','poll','left='+ (chasm - Width - 10)* .5+',top='+(mount - Height - 30)* .5+',width='+ Width +',height='+ Height +',toolbar=1,resizable=0');	
	document.forms[0].target='poll';
	document.forms[0].action='/Poll.aspx';
	document.forms[0].__VIEWSTATE.name = 'NOVIEWSTATE';
	document.forms[0].method = "post";
   	document.forms[0].submit();	
}*/
function OnCmdSubmitClick(LocationRequest, nameRad, Width, Height)
{
	var chasm = screen.availWidth;
	var mount = screen.availHeight;
	var bIsChecked = false;
	var r = document.getElementsByName(nameRad);
		for(i=0;i<r.length;i++)
		{
			if( r[i].checked )
			{
			window.open('/UserControls/Poll/default.aspx?results='+ r[i].value +'&LID='+LocationRequest,'Poll','left='+ (chasm - Width - 10)* .5+',top='+(mount - Height - 30)* .5+',width='+ Width +',height='+ Height +',toolbar=1,resizable=0');
			bIsChecked = true;
			break;
			}
		}
	if(!bIsChecked ) alert("Hãy ch?n ít nh?t m?t m?c ?? bình ch?n!");
	return bIsChecked;
}

function OnCmdViewClick(LocationRequest, Width, Height)
{
	var chasm = screen.availWidth;
	var mount = screen.availHeight;
	window.open('/UserControls/Poll/default.aspx?results=-1&LID='+LocationRequest,'Poll','locationbar=no,left='+ (chasm - Width - 10)* .5+',top='+(mount - Height - 30)* .5+',width='+ Width +',height='+ Height +',toolbar=1,resizable=0');
}



/***********************************************
* Image w/ description tooltip- By Dynamic Web Coding (www.dyn-web.com)
* Copyright 2002-2007 by Sharon Paine
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

/* IMPORTANT: Put script after tooltip div or 
	 put tooltip div just before </BODY>. */

var dom = (document.getElementById) ? true : false;
var ns5 = (!document.all && dom || window.opera) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var ie4 = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !ie4 && !ie5 && !dom) ? true : false;

var origWidth, origHeight;

// avoid error of passing event object in older browsers
if (nodyn) { event = "nope" }

///////////////////////  CUSTOMIZE HERE   ////////////////////
// settings for tooltip 
// Do you want tip to move when mouse moves over link?
var tipFollowMouse= true;	
// Be sure to set tipWidth wide enough for widest image
var tipWidth= 160;
var offX= 20;	// how far from mouse to show tip
var offY= 12; 
var tipFontFamily= "Verdana, arial, helvetica, sans-serif";
var tipFontSize= "8pt";
// set default text color and background color for tooltip here
// individual tooltips can have their own (set in messages arrays)
// but don't have to
var tipFontColor= "#000000";
var tipBgColor= "#DDECFF"; 
var tipBorderColor= "#cccccc";
var tipBorderWidth= 1;
var tipBorderStyle= "ridge";
var tipPadding= 2;


// to layout image and text, 2-row table, image centered in top cell
// these go in var tip in doTooltip function
// startStr goes before image, midStr goes between image and text
var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="100%"><img src="';
var midStr = '" border="0"></td></tr><tr><td valign="top">';
var endStr = '</td></tr></table>';

////////////////////////////////////////////////////////////
//  initTip	- initialization for tooltip.
//		Global variables for tooltip. 
//		Set styles
//		Set up mousemove capture if tipFollowMouse set true.
////////////////////////////////////////////////////////////
var tooltip, tipcss;
function initTip() {
	if (nodyn) return;
	tooltip = (ie4)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
	tipcss = tooltip.style;
	if (ie4||ie5||ns5) {	// ns4 would lose all this on rewrites
		//tipcss.width = tipWidth+"px";
		tipcss.fontFamily = tipFontFamily;
		tipcss.fontSize = tipFontSize;
		tipcss.color = tipFontColor;
		tipcss.backgroundColor = tipBgColor;
		tipcss.borderColor = tipBorderColor;
		tipcss.borderWidth = tipBorderWidth+"px";
		tipcss.padding = tipPadding+"px";
		tipcss.borderStyle = tipBorderStyle;
	}
	if (tooltip&&tipFollowMouse) {
		document.onmousemove = trackMouse;
	}
}

window.onload = initTip;

/////////////////////////////////////////////////
//  doTooltip function
//			Assembles content for tooltip and writes 
//			it to tipDiv
/////////////////////////////////////////////////
var t1,t2;	// for setTimeouts
var tipOn = false;	// check if over tooltip link
function doTooltip(evt,image, text, bgcolor, color) {
	if (!tooltip) return;
	if (t1) clearTimeout(t1);	if (t2) clearTimeout(t2);
	tipOn = true;
	// set colors if included in messages array
	if (bgcolor)	var curBgColor = bgcolor;
	else curBgColor = tipBgColor;
	if (color)	var curFontColor = color;
	else curFontColor = tipFontColor;
	if (ie4||ie5||ns5) {
		var tip = startStr + image + midStr + '<span style="font-family:' + tipFontFamily + '; font-weight: normal; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + text + '</span>' + endStr;
		tipcss.backgroundColor = curBgColor;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);
}


var mouseX, mouseY;
function trackMouse(evt) {
	standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
	mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
	mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	if (tipOn) positionTip(evt);
}

/////////////////////////////////////////////////////////////
//  positionTip function
//		If tipFollowMouse set false, so trackMouse function
//		not being used, get position of mouseover event.
//		Calculations use mouseover event position, 
//		offset amounts and tooltip width to position
//		tooltip within window.
/////////////////////////////////////////////////////////////
function positionTip(evt) {
	if (!tipFollowMouse) {
		mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
		mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
	}
	// tooltip width and height
	var tpWd = (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
	// document area in view (subtract scrollbar width for ns)
	var winWd = (ns5)? window.innerWidth-20+window.pageXOffset: standardbody.clientWidth+standardbody.scrollLeft;
	var winHt = (ns5)? window.innerHeight-20+window.pageYOffset: standardbody.clientHeight+standardbody.scrollTop;
?	// check mouse position against tip and window dimensions
	// and position the tooltip 
	if ((mouseX+offX+tpWd)>winWd) 
		tipcss.left = mouseX-(tpWd+offX)+"px";
	else tipcss.left = mouseX+offX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		tipcss.top = winHt-(tpHt+offY)+"px";
	else tipcss.top = mouseY+offY+"px";
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}

document.write('<div id="tipDiv" style="position:absolute; visibility:hidden; z-index:100"></div>')


