var popUpWin=0;
function popUpWindow(URLStr)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  var ht = screen.height; 
	var wdth = screen.width; 
	var newWidth = 750; 
	var newHeight = 500; 
	var lft = (wdth / 2) - (newWidth / 2); 
	var tp = (ht / 2) - (newHeight / 2);
  popUpWin = open(URLStr, "popUpWin", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,left=" + lft + ",top=" + tp + ",width=" + newWidth + ",height=" + newHeight);
}

/////////////////pre loader//////////////////////

var t_id = setInterval(animate,20);
var pos=0;
var dir=2;
var len=0;
function animate()
{
	var elem = document.getElementById('progress');
	if(elem != null) {
		if (pos==0) len += dir;
		if (len>32 || pos>79) pos += dir;
		if (pos>79) len -= dir;
		if (pos>79 && len==0) pos=0;
		elem.style.left = pos;
		elem.style.width = len;
	}
}
function remove_loading() {
	this.clearInterval(t_id);
	var targelem = document.getElementById('loader_container');
	targelem.style.display='none';
	targelem.style.visibility='hidden';
}

var mypop=0;

function win(id,popwin) {
var ht = screen.height; 
var wdth = screen.width; 
var newWidth = 580; 
var newHeight = 500; 
var lft = (wdth / 2) - (newWidth / 2); 
var tp = (ht / 2) - (newHeight / 2);

 if(mypop)
  {
    if(!mypop.closed) mypop.close();
  } 
   mypop = window.open("reviews_popup.php?cap="+id+"","", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,left=" + lft + ",top=" + tp + ",width=" + newWidth + ",height=" + newHeight);

}

function eventwin(){
	var ht = screen.height; 
	var wdth = screen.width; 
	var newWidth = 500; 
	var newHeight = 400; 
	var lft = (wdth / 2) - (newWidth / 2); 
	var tp = (ht / 2) - (newHeight / 2);
   
win = window.open("event_popup.php","newWin", "toolbar=no,location=no,directories=no,status=no, menubar=no,scrollbars=no,resizable=no,copyhistory=no,left=" + lft + ",top=" + tp + ",width=" + newWidth + ",height=" + newHeight);        

}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


