//var req;
// 
//function loadXMLDoc(url)
//{
//    req = null;
//    if (window.XMLHttpRequest) {
//        try {
//            req = new XMLHttpRequest();
//        } catch (e){}
//    } else if (window.ActiveXObject) {
//        try {
//            req = new ActiveXObject('Msxml2.XMLHTTP');
//        } catch (e){
//            try {
//                req = new ActiveXObject('Microsoft.XMLHTTP');
//            } catch (e){}
//        }
//    }
// 
//    if (req) {
//        req.onreadystatechange = processReqChange;
//        req.open("GET", url, true);
//        req.send(null);
//    }
//}
// 
//function processReqChange()
//{
//  try {
//    if (req.readyState == 4) {
//        if (req.status == 200) {
//            //document.write(req.responseText);
//        } else {
//            alert("ERROR:\n" +req.statusText);
//        }
//    }
//  }
//  catch( e ) {
//       alert('Caught Exception: ' + e.description);
//  }
//}

/* Tips 1 */
/*window.addEvent('domready', function() {
var Tips2 = new Tips($$('.Tips2'), {
	initialize:function(){
		this.fx = new Fx.Style(this.toolTip, 'opacity', {duration: 500, wait: false}).set(0);
	},
	onShow: function(toolTip) {
		this.fx.start(1);
	},
	onHide: function(toolTip) {
		this.fx.start(0);
	}
	
});
})
*/


var please_wait = null;

function open_url(url, target) {
 	if ( ! document.getElementById) {
  		return false;
 	}

 	if (please_wait != null) {
  		document.getElementById(target).innerHTML = please_wait;
 	}

 	if (window.ActiveXObject) {
  		req = new ActiveXObject("Microsoft.XMLHTTP");
 	} else if (window.XMLHttpRequest) {
  		req = new XMLHttpRequest();
 	}

 	if (req == undefined) {
  		return false;
 	}
 	req.onreadystatechange = function() { response(url, target); }
 	req.open("GET",url, true);
 	req.send(null);
}

function response(url, target) {
 	if (req.readyState == 1) {
		document.getElementById(target).innerHTML = "Loading...";
	}
 	if (req.readyState == 4) {
		document.getElementById(target).innerHTML = (req.status == 200) ? req.responseText : "Ooops!! A broken link! Please contact the webmaster of this website ASAP and give him the fallowing errorcode: " + req.status;
	}
}

//
function open_c(id){
	document.getElementById(id).className='show';

	}

function close_c(id){	
	document.getElementById(id).className='hide';
	}
function open_div(id , popPic){
	document.getElementById(id).className='show';
	document.poppic.src=popPic;
	}
function close_div2(id){	
	document.getElementById(id).className='hide';
	document.getElementById("miban").innerHTML = "";
	}
function close_div(id){	
	document.getElementById(id).className='hide';
	}
	
	function openOnMouseOver(id,itemID,ss){

	setTimeout(function() {
    ox=posX+5;
	oy=posY+5;
	var box = document.getElementById(id);
	box.className='show';
	box.style.left = ox+'px';
	box.style.top = oy+'px';
    open_url('footer_work.php?ss='+ss+'&workid='+itemID,'miban');
	},100)
	}
	
	
	var isIE = document.all ? true : false;
	document.onmousemove = getMousePosition;
	
	function getMousePosition(e) {
	var _x;
	var _y;
	if (!isIE) {
		_x = e.pageX;
		_y = e.pageY;
	}
	if (isIE) {
		_x = event.clientX + document.body.scrollLeft;
		_y = event.clientY + document.body.scrollTop;
	}
	
    posX = _x;
	posY = _y;
	return true;
}



//function ShowPic(img , id){
//     
//     xmlhttp.open('POST', "update_picture.php", false);
//     
//     xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');     
//     
//     sendString = "img=" + img;     
//     
//     xmlhttp.send(sendString);
//     
//     if ( xmlhttp.readyState == 4 ){     
//     
//          var xmlResponse = xmlhttp.responseText;
//     }          
//     
//     document.getElementById("show_pic").innerHTML = xmlResponse;     
//     document.getElementById("show_pic").className = "vis";
//}



// shat karevor onmouseover="openOnMouseOver(\'mouseoverblock\',\''.$workObj->getID().'\',\''.$_GET['subsection'].'\' )" onMouseout="close_div2(\'mouseoverblock\')"
