//*****//
/*
 * Clear Default Text: functions for clearing and replacing default text in
 * <input> elements.
 *
 * by Ross Shannon, http://www.yourhtmlsource.com/
 */
 
 //class="cleardefault"

//addEvent(window, 'load', init, false);
//
//function init() {
//    var formInputs = document.getElementsByTagName('input');
//    for (var i = 0; i < formInputs.length; i++) {
//        var theInput = formInputs[i];
//        
//        if (theInput.type == 'text' && theInput.className.match(/\bcleardefault\b/)) {  
//            /* Add event handlers */          
//            addEvent(theInput, 'focus', clearDefaultText, false);
//            addEvent(theInput, 'blur', replaceDefaultText, false);
//            
//            /* Save the current value */
//            if (theInput.value != '') {
//                theInput.defaultText = theInput.value;
//            }
//        }
//    }
//}

function clearDefaultText(e) {
//    var target = window.event ? window.event.srcElement : e ? e.target : null;
//    if (!target) return;
//alert("OK: "+e.value);
var elmSelectKeyworks = e.value;
    
    if (e.value == elmSelectKeyworks) {
        e.value = '';
    }
}

function replaceDefaultText(e) {
//    var target = window.event ? window.event.srcElement : e ? e.target : null;
//    if (!target) return;
//alert("OK: "+e.value);
var elmSelectKeyworks = e.value;

    if (e.value == '' && e.elmSelectKeyworks) {
        e.value = e.elmSelectKeyworks;
    }
}

/****** Popup Image *******/

// Set the horizontal and vertical position for the popup

PositionX = 10;
PositionY = 10;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 300;
defaultHeight = 300;

// 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=auto,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=auto,width=150,height=100,left='+PositionX+',top='+PositionY;

function PopUpImageShw(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;background-color:#CCCCCC;}</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('window.resizeTo(300,300);');
writeln('width=300-(document.body.clientWidth-document.images[0].width);');
writeln('height=300-(document.body.clientHeight-document.images[0].height);');
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('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();		
}}

/* end Create new page image */

/* Popup HTML Image*/
// copyhistory=yes,
//newWindow = window.open("someDoc.html","subWind","status,menubar,height=400,width=300");
//newWindow.focus( );

function PopUpNewWindowShw(FileURL,FileTitle,sWidth,sHight){
	var NewWindows;
	WinOpt = 'width='+sWidth+',height='+sHight+',toolbar=no,location=no,directories=yes,status=yes,menubar=no,scrollbars=yes,resizable=yes,top=0';
	NewWindows = window.open(FileURL,FileTitle,WinOpt);
	NewWindows.focus();
}


/* ######Tab ######*/

function TabDisplay(sID) {

	divObj = document.getElementById(sID);
	if (divObj) {
		divObj.style.display='inline';
	}
}

function TabHide(sID) {
	divObj = document.getElementById(sID);
	if (divObj) {
		divObj.style.display='none';
	}
}

function TabGetDisplay(id){


	for (i=1;i<=5;i++)
	{
		if (id == i)
		{
			TabDisplay("BoxContent_"+i);
      		//document.getElementById("li"+i).className ='font18';
		}else{
			TabHide("BoxContent_"+i);
      		//document.getElementById("li"+i).className ='font12';
		}
	}

}

function TabClicktab(id){

	for (i=1;i<=6;i++)
	{
		if (id == i)
		{
			TabDisplay("BoxContent_"+i);
      		//document.getElementById("li"+i).className ='font18';
		}else{
			TabHide("BoxContent_"+i);
      		//document.getElementById("li"+i).className ='font12';
		}
	}

	//TabStoper();
	//timer = setTimeout("TabRotate("+id+","+1000+")", 5000);
}

function TabStoper() {
	clearTimeout(timer);
}

function TabRotate(id,settime){
	if (id >5){id=1;}
		TabGetDisplay(id);
		id++;
		//timer = setTimeout("TabRotate("+id+","+settime+")", settime);

}

/* end page tab */


/* ### Tooltip ####*/
// position of the tooltip relative to the mouse in pixel //
var offsetx = 12;
var offsety =  8;

function newelement(newid)
{ 
    if(document.createElement)
    { 
        var el = document.createElement('div'); 
        el.id = newid;     
        with(el.style)
        { 
            display = 'none';
            position = 'absolute';
        } 
        el.innerHTML = '&nbsp;'; 
        document.body.appendChild(el); 
    } 
} 
var ie5 = (document.getElementById && document.all); 
var ns6 = (document.getElementById && !document.all); 
var ua = navigator.userAgent.toLowerCase();
var isapple = (ua.indexOf('applewebkit') != -1 ? 1 : 0);
function getmouseposition(e)
{
    if(document.getElementById)
    {
        var iebody=(document.compatMode && 
        	document.compatMode != 'BackCompat') ? 
        		document.documentElement : document.body;
        pagex = (isapple == 1 ? 0:(ie5)?iebody.scrollLeft:window.pageXOffset);
        pagey = (isapple == 1 ? 0:(ie5)?iebody.scrollTop:window.pageYOffset);
        mousex = (ie5)?event.x:(ns6)?clientX = e.clientX:false;
        mousey = (ie5)?event.y:(ns6)?clientY = e.clientY:false;

        var lixlpixel_tooltip = document.getElementById('tooltip');
        lixlpixel_tooltip.style.left = (mousex+pagex+offsetx) + 'px';
        lixlpixel_tooltip.style.top = (mousey+pagey+offsety) + 'px';
    }
}
function tooltip(tip)
{
    if(!document.getElementById('tooltip')) newelement('tooltip');
    var lixlpixel_tooltip = document.getElementById('tooltip');
    lixlpixel_tooltip.innerHTML = tip;
    lixlpixel_tooltip.style.display = 'block';
    document.onmousemove = getmouseposition;
}
function exit()
{
    document.getElementById('tooltip').style.display = 'none';
}

/* End Tooltip */
