// JavaScript Document Template sites

// Image pre-loader
var tImg=new Array()
function preloadimages()
{
	for (i=0;i<preloadimages.arguments.length;i++)
	{
		tImg[i]=new Image()
		tImg[i].src=preloadimages.arguments[i]
	}
}
preloadimages("img/logo.png","img/footer-bg.png","img/header-bg.png","img/navigation/tab1.png","img/navigation/tab2.png","img/mdl-name-bg.png","img/imdl-name-bg2.png","img/model-option-btns.png","img/btn-back.png","img/scroll-next.png","img/scroll-prev.png","img/track-bg.png","img/ajax-loader.gif");

//set 'min-width' of header and footer to largest intro image
function introImgWidth(img,elem) {
	var imgWidth = $(img).width();
	$('#' + elem).css('min-width',imgWidth);
}

// set custom scroller to window width
function scrollerWidth(id,scrollid,trackid,hold,loader) {
	var holdWidth = $('#' + hold).width();
	var trackWidth = holdWidth - 28;
	$('#' + id).css('width', holdWidth + 'px');
	$('#' + loader).css('width', holdWidth + 'px');
	$('#' + trackid).css('width', trackWidth + 'px');
	$('#' + scrollid).css('width', holdWidth + 'px');
}

/*function getMdlLink(class) {
	var linkWidth, linkHeight, marginWidth, marginHeight;
	linkWidth = $('.' + class).width();
	linkHeight = $('.' + class).height();
	
	marginWidth = linkWidth/2;
	marginHeight = linkHeight/2;
	//alert(linkWidth);
	$('.' + class).css('margin-top', '-' + marginHeight + 'px');
	$('.' + class).css('margin-left', '-' + marginWidth + 'px');
	alert(linkWidth + " " + linkHeight);
}*/
