// JavaScript Document
var currentUrl = false;
function roll(img_name1, img_src1,img_url)
{
	document[img_name1].src = img_src1;
	currentUrl = img_url;
}

function popUp(url,width,height){

    attrib = 'width=' + width + ',height='+ height+ ',top=10,left=10,scrollbars=yes';
    popwindow = window.open(url,'PopUp',attrib);
}

/**
 * body onload 
 */

function actionOnload(e) {
	// might come in handy but empty for now
}

/**
 * jQuery onload
 */
$(document).ready(function() {
	Cufon.replace('h2.title');
	//Cufon.replace('h2.cufon');
	
	$(function() {
		if ($('table.galery td a')){
		    $('table.galery td a').lightBox({
		    	imageLoading: '/static/ppl/img/loading.gif',
		    	imageBtnClose: '/static/ppl/img/btn_close.gif',
		    	imageBtnPrev: '/static/ppl/img/btn_previous.gif',
		    	imageBtnNext: '/static/ppl/img/btn_next.gif'
		    });
		}
	});
});


//
// GENERAL FUNCTIONS...
//

//
// THIS IS TAKEN FROM
// http://www.quirksmode.org/js/findpos.html
//

function findPos(obj) {
  var curleft = curtop = 0;
  if (obj.offsetParent) {
    curleft = obj.offsetLeft
    curtop = obj.offsetTop
    while (obj = obj.offsetParent) {
      curleft += obj.offsetLeft
      curtop += obj.offsetTop
    }
  }
  return [curleft,curtop];
}

function loadjs(filename) {	
	elScript = document.createElement('script');
	elScript.setAttribute("type","text/javascript");
	elScript.setAttribute("src", filename);
	document.getElementsByTagName('head')[0].appendChild(elScript);
}

function loadcss(filename) {	
	elScript = document.createElement('link');
	elScript.setAttribute("type","text/css");
	elScript.setAttribute("rel","stylesheet");
	elScript.setAttribute("href", filename);
	document.getElementsByTagName('head')[0].appendChild(elScript);
}
