/* author: Imran Sikander */
/* Company: Sulaiman Information Dev. */
/* Creation date: 10/04/01 */
/* Last Updated: 29/4/01 */

var ns = (document.layers)? true:false
var ie = (document.all)? true:false


/*This Function is used to begin a Layer or Div tag depending upon the browser and the parameters*/
function openlyr(lyrparam){
if(ns){
	document.write("<layer "+lyrparam+">")}
else{
	document.write("<div "+lyrparam+">")
}
}

/*This Function is used to end a Layer or Div tag depending upon the browser*/
function closelyr(){
if(ns){
	document.write("<\/layer>")}
else{
	document.write("<\/div>")
}
}

/*This Function is used to insert an HTML into Layer or Div*/
function inserthtml(lyr,htm){ 
if(ns){
	document.layers[lyr].document.write(htm);
	document.layers[lyr].document.close();
}
else{
	document.all.item(lyr).innerHTML=htm;
}
}

/*This Function is used show Layer or Div*/
function show(lyr){
if(ns){
	document.layers[lyr].visibility="visible";}
else{
	document.all.item(lyr).style.visibility="visible";}
}

/*This Function is used hide Layer or Div*/
function hide(lyr){
if(ns){
	document.layers[lyr].visibility="hide";}
else{
	document.all.item(lyr).style.visibility="hidden";}
}

/*This Function is used to add zoom icon         */
function pic_w_zoom(lyr_id,lyr_prm,img_prm,ffclick){
htm=""
htm=htm+"<table cellspacing='0' cellpadding='0'border='1' style='background: #000000; border-bottom-color: #000000; border-left-color: #000000; border-right-color: #000000; border-top-color: #000000; border-width: thin'>"
htm=htm+"<tr>"
htm=htm+"<td align='center' colspan='2'>"+img_prm+"<\/td>"
htm=htm+"<\/tr>"
htm=htm+"<tr bordercolor='#000000'>"
htm=htm+"<td class='vbk2' align='center' nowrap><small><font color='#ffffff'>Click To Zoom</font></small></td><td align='right'><img src='images\/zoomout.jpg' border='0' onclick='"+ffclick+"' onmouseover = 'this.src=\"images/zoomin.jpg\"' onmouseout = 'this.src=\"images/zoomout.jpg\"' style='cursor: hand'><\/td>"
htm=htm+"<\/tr>"
htm=htm+"<\/table>"
openlyr(lyr_prm);
inserthtml(lyr_id,htm);
closelyr();
}

/*This Function is used to add zoom icon  (For Tiny Pics only)       */
function pic_w_zoom_tiny(lyr_id,lyr_prm,img_prm,ffclick){
htm=""
htm=htm+"<table cellspacing='0' cellpadding='0'border='1' style='background: #000000; border-bottom-color: #000000; border-left-color: #000000; border-right-color: #000000; border-top-color: #000000; border-width: thin'>"
htm=htm+"<tr>"
htm=htm+"<td align='center'>"+img_prm+"<\/td><td align='right' bgcolor='99ffff' valign='bottom'><img src='images\/zoomout.jpg' border='0' onclick='"+ffclick+"' onmouseover = 'this.src=\"images/zoomin.jpg\"' onmouseout = 'this.src=\"images/zoomout.jpg\"' style='cursor: hand'><\/td>"
htm=htm+"<\/tr>"
htm=htm+"<\/table>"
openlyr(lyr_prm);
inserthtml(lyr_id,htm);
closelyr();
}

/*This Function moves the layer where the mose points*/
function movelyr(lyr){
if (ns){

}
else{
	if (event.x<=500){
		document.all.item(lyr).style.left=event.x+document.body.scrollLeft+10;
		document.all.item(lyr).style.top=event.y+document.body.scrollTop+10;
		show("info");}
	else if(event.x>500){
		document.all.item(lyr).style.left=event.x+document.body.scrollLeft-220+10;
		document.all.item(lyr).style.top=event.y+document.body.scrollTop+10;
		show("info");}
}
}
