var templateImages=new Array();
templateImages[1]=new Array("leftBar.jpg","15461");
templateImages[2]=new Array("rightBar.jpg","22856");
templateImages[3]=new Array("menu_background.jpg","7683");
templateImages[4]=new Array("fadeBar.jpg","447");
templateImages[8]=new Array("dioni.jpg","16743");
templateImages[9]=new Array("ajax-loader.gif","10819");
templateImages[10]=new Array("paypal.gif","2669");
templateImages[11]=new Array("paypal_logo.gif","1115");
templateImages[12]=new Array("redirect.gif","9676");

var templateTotalImages=9;
var templateLoadedImages=0;
var templateTotalBytes=87469;
var templateTotalBytesLoaded=0;

$(document).ready(function(){
	$("#hideAll").css({"z-index":"1000000","position":"absolute","left":"0px","top":"0px","width":"100%","height":"100%"});
	$("#cViewloader").css({"z-index":"10000000","position":"absolute","left":((document.body.clientWidth/2)-60)+"px","top":"200px","width":"120px"});
	$("#progressbar").reportprogress(0,templateTotalBytes);
	$('body').append("<div id='cloader'></div>");
	$('#cloader').css({'position':'absolute','top':'-3000px','width':'0px','height':'1px','overflow':'hidden'});
	$('#cloader').append("<img src='/images/themes/1/leftBar.jpg' onLoad='templateCheckLoad(1);' onError='alert(1);'/><img src='/images/themes/1/rightBar.jpg' onLoad='templateCheckLoad(2);' onError='alert(2);'/><img src='/images/themes/1/menu_background.jpg' onLoad='templateCheckLoad(3);' onError='alert(3);'/><img src='/images/themes/1/fadeBar.jpg' onLoad='templateCheckLoad(4);' onError='alert(4);'/><img src='/images/themes/1/dioni.jpg' onLoad='templateCheckLoad(8);' onError='alert(8);'/><img src='/images/themes/1/ajax-loader.gif' onLoad='templateCheckLoad(9);' onError='alert(9);'/><img src='/images/themes/1/paypal.gif' onLoad='templateCheckLoad(10);' onError='alert(10);'/><img src='/images/themes/1/paypal_logo.gif' onLoad='templateCheckLoad(11);' onError='alert(11);'/><img src='/images/themes/1/redirect.gif' onLoad='templateCheckLoad(12);' onError='alert(12);'/>");
});

function templateCheckLoad(id){
	templateLoadedImages+=1;
	templateTotalBytesLoaded+=parseInt(templateImages[id][1]);
	$("#progressbar").reportprogress(templateTotalBytesLoaded,templateTotalBytes);
}
var showStart=0;

								(function($){
								$.fn.reportprogress = function(val,maxVal) {
									var max;
									if(maxVal){
										max=maxVal
									}else{
										max=100;
									}
									var width=Math.round(val/max*100);
									$("#progress").animate({"width":width+"%"},100,function(){
										if((val>=max) && showStart!=1){
											showStart=1;
											$("#cViewloader").fadeOut("fast",function(){
												$("#hideAll").fadeOut("slow",function(){
													show("dione");
												});
											});
										}
										});
								}})(jQuery);
function setAjax(){
$(".text a").attr("rel","noajax");
$(".page a").attr("rel","noajax");
$("#pageText a[@rel!=noajax]").each(function(){
if($(this).attr("ajaxSet")!=1){
$(this).attr("ajaxSet",1);
$(this).bind("click",function(){if($(this).attr("href").split("&jsDynamic:")[1]){	var a=$(this).attr("href").split("&jsDynamic:")[1].replace("(","").replace(")","");	if($.browser.msie){var attrs=a.split("%7C");}else{var attrs=a.split("|");}	var tmp="";	for (var i=0;i<attrs.length;i++){		tmp="&"+attrs[i]+"="+(($(this).attr(attrs[i]))?$(this).attr(attrs[i]):"")+tmp;	}	var href=$(this).attr("href").split("&jsDynamic:")[0]+tmp;	$(this).attr("href",href);}else{	var href=$(this).attr("href");
}$(this).doajax("#mainContent","fadeIn|slow");return false;
						});
}});
$("#navigation a[@rel!=noajax]").each(function(){
if($(this).attr("ajaxSet")!=1){
$(this).attr("ajaxSet",1);
$(this).bind("click",function(){if($(this).attr("href").split("&jsDynamic:")[1]){	var a=$(this).attr("href").split("&jsDynamic:")[1].replace("(","").replace(")","");	if($.browser.msie){var attrs=a.split("%7C");}else{var attrs=a.split("|");}	var tmp="";	for (var i=0;i<attrs.length;i++){		tmp="&"+attrs[i]+"="+(($(this).attr(attrs[i]))?$(this).attr(attrs[i]):"")+tmp;	}	var href=$(this).attr("href").split("&jsDynamic:")[0]+tmp;	$(this).attr("href",href);}else{	var href=$(this).attr("href");
}$(this).doajax("#mainContent","fadeIn|slow");return false;
						});
}});
$("#userMenu a[@rel!=noajax]").each(function(){
if($(this).attr("ajaxSet")!=1){
$(this).attr("ajaxSet",1);
$(this).bind("click",function(){if($(this).attr("href").split("&jsDynamic:")[1]){	var a=$(this).attr("href").split("&jsDynamic:")[1].replace("(","").replace(")","");	if($.browser.msie){var attrs=a.split("%7C");}else{var attrs=a.split("|");}	var tmp="";	for (var i=0;i<attrs.length;i++){		tmp="&"+attrs[i]+"="+(($(this).attr(attrs[i]))?$(this).attr(attrs[i]):"")+tmp;	}	var href=$(this).attr("href").split("&jsDynamic:")[0]+tmp;	$(this).attr("href",href);}else{	var href=$(this).attr("href");
}$(this).doajax("#allContent","fadeIn|slow");return false;
						});
}});
$("#menu a[@rel!=noajax]").each(function(){
if($(this).attr("ajaxSet")!=1){
$(this).attr("ajaxSet",1);
$(this).bind("click",function(){if($(this).attr("href").split("&jsDynamic:")[1]){	var a=$(this).attr("href").split("&jsDynamic:")[1].replace("(","").replace(")","");	if($.browser.msie){var attrs=a.split("%7C");}else{var attrs=a.split("|");}	var tmp="";	for (var i=0;i<attrs.length;i++){		tmp="&"+attrs[i]+"="+(($(this).attr(attrs[i]))?$(this).attr(attrs[i]):"")+tmp;	}	var href=$(this).attr("href").split("&jsDynamic:")[0]+tmp;	$(this).attr("href",href);}else{	var href=$(this).attr("href");
}$(this).doajax("#page","fadeIn|slow");return false;
						});
}});
}
