function wo(URL,wh){
window.open(URL,'newWin',wh);
}

var myviewer = {
'ShowLayer' : function (x, y, obj, posx, posy, z){
	//(0, 1, this, 300, -100, 1)
	
	tb_show(null,obj.href,"group");
	
	return true;
}
}

function subWinOpen(wName,w,h){
	window.open(wName,"newwin","width="+w+",height="+h+",scrollbars=0");
}

function up(wName){
//window.open(wName,"newwin","width=400,height=260,scrollbars=0");
tb_show(null,wName,null);
}

function check_ok(String){
if (window.confirm(String)) {
return true;		
}else{
return false;
}
}

function blink(A,B){
te1=A;
te2=B;
m=te1;
cnt=0;
textblink();
}

function textblink(){
	document.getElementById('blink').style.color=m;
	cnt++;
	if(cnt==1){m=te2;}
	else {cnt=0;m=te1;}
	setTimeout("textblink()",500);
}


/****************************************
* Show Overlay and box
****************************************/
function showBox(){
    $('overlay').show();
    overlayReload();
    center('box', '300', '100');// Size of the box
    return false;
}
/****************************************
* Adjust overlay to new window size
****************************************/
function overlayReload()
{
    if (window.innerHeight && window.scrollMaxY || window.innerWidth && window.scrollMaxX) {    
        yScroll = window.innerHeight + window.scrollMaxY;
        xScroll = window.innerWidth + window.scrollMaxX;
        var deff = document.documentElement;
        var wff = (deff&&deff.clientWidth) || document.body.clientWidth || window.innerWidth || self.innerWidth;
        var hff = (deff&&deff.clientHeight) || document.body.clientHeight || window.innerHeight || self.innerHeight;
        xScroll -= (window.innerWidth - wff);
        yScroll -= (window.innerHeight - hff);
    } else if (document.body.scrollHeight > document.body.offsetHeight || document.body.scrollWidth > document.body.offsetWidth){ // all but Explorer Mac
        yScroll = document.body.scrollHeight;
        xScroll = document.body.scrollWidth;
    } else { // Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari
        yScroll = document.body.offsetHeight;
        xScroll = document.body.offsetWidth;
      }

    $('page_overlay').style.height = yScroll;
    $('page_overlay').style.width = xScroll;
}
/****************************************
* Actually center box
****************************************/
function center(window_name, _width, _height) {
    var successWin = $(window_name);
    var pagesize = getPageSize();    
    var arrayPageScroll = getPageScrollTop();
    successWin.style.left = (arrayPageScroll[0] + (pagesize[0] - _width)/2);
    successWin.style.top = (arrayPageScroll[1] + (pagesize[1] - _height)/3);
}
/****************************************
*
****************************************/
function getPageSize(){
    var de = document.documentElement;
    var w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
    var h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight
    arrayPageSize = new Array(w,h) 
    return arrayPageSize;
}
/****************************************
*
****************************************/
function getPageScrollTop(){
    var yScrolltop;
    var xScrollleft;
    if (self.pageYOffset || self.pageXOffset) {
        yScrolltop = self.pageYOffset;
        xScrollleft = self.pageXOffset;
    } else if (document.documentElement && document.documentElement.scrollTop || document.documentElement.scrollLeft ){     // Explorer 6 Strict
        yScrolltop = document.documentElement.scrollTop;
        xScrollleft = document.documentElement.scrollLeft;
    } else if (document.body) {// all other Explorers
        yScrolltop = document.body.scrollTop;
        xScrollleft = document.body.scrollLeft;
    }
    arrayPageScroll = new Array(xScrollleft,yScrolltop) 
    return arrayPageScroll;
}

function tb_show_innerHTML(caption,width,height) {//function called when the user clicks on a thickbox link

	try {
		if (typeof document.body.style.maxHeight === "undefined") {//if IE 6
			$("body","html").css({height: "100%", width: "100%"});
			$("html").css("overflow","hidden");
			if (document.getElementById("TB_HideSelect") === null) {//iframe to hide select elements in ie6
				$("body").append("<iframe id='TB_HideSelect'></iframe><div id='TB_overlay'></div><div id='TB_window'></div>");
				$("#TB_overlay").click(tb_remove);
			}
		}else{//all others
			if(document.getElementById("TB_overlay") === null){
				$("body").append("<div id='TB_overlay'></div><div id='TB_window'></div>");
				$("#TB_overlay").click(tb_remove);
			}
		}

		if(tb_detectMacXFF()){
			$("#TB_overlay").addClass("TB_overlayMacFFBGHack");//use png overlay so hide flash
		}else{
			$("#TB_overlay").addClass("TB_overlayBG");//use background and opacity
		}

		if(caption===null){caption="";}
		$("body").append("<div id='TB_load'><img src='"+imgLoader.src+"' /></div>");//add loader to the page
		$('#TB_load').show();//show loader

		$("#TB_window").append("<div id='TB_ajaxContent' class='TB_modal' style='width:500px;height:300px;'></div>");
		$("#TB_ajaxContent")[0].scrollTop = 0;
		//$("#TB_ajaxWindowTitle").html(caption);
		$("#TB_ajaxContent").html(caption);
		$("#TB_closeWindowButton").click(tb_remove);


		
		TB_WIDTH = 500;
		TB_HEIGHT = 300;
		tb_position();
		$("#TB_load").remove();
		tb_init("#TB_ajaxContent a.thickbox");
		$("#TB_window").css({display:"block"});
		
	} catch(e) {
		//nothing here
		alert(e);
	}
}

