/* google analytics code */
 var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-12832687-5']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();
/* google analytics code end */

/*-- onload execution --*/
  if (dl.is.ie6){  dl.load.push("document.execCommand('BackgroundImageCache', false, true)"); }
/*-- site functions --*/
/* library functions */
add=function(tag,cls,par)
{	//var el=(tag=='IFRAME'&&!ns6)? document.createElement('<IFRAME FRAMEBORDER=0 allowTransparency="true"></IFRAME>') : document.createElement(tag);
	var el=document.createElement(tag);
	if(cls)	el.id=el.className=cls;
	if(par) par.appendChild(el)
return el;
}
/* open/close element */
function show(id)
{	var body=document.getElementsByTagName('body').item(0);
	var html=dl.d.getElementsByTagName('html').item(0);
	var selArr=document.getElementsByTagName('select');
	dl.el(id).on();
	dl.el(id).style.marginLeft=-parseInt(dl.el(id).offsetWidth/2)+parseInt(html.scrollLeft)+'px';
	dl.el(id).style.marginTop=-parseInt(dl.el(id).offsetHeight/2)+parseInt(html.scrollTop)+'px';
	if(selArr)
		for(var i=selArr.length-1;i>=0;i--)	selArr[i].style.visibility="hidden";
	if(!dl.is.el('over')) add('DIV','over',body);
	dl.el('over').on();
	dl.el('over').onclick=function(){hide(id)};
	dl.el('over').style.height=html.scrollHeight+'px';
}
function hide(id)
{	if (!dl.is.el(id)) return;
	dl.el(id).off();
	if(dl.is.el('over')) dl.el('over').off();
	var selArr=document.getElementsByTagName('select');
	if(selArr)
		for(var i=selArr.length-1;i>=0;i--)	selArr[i].style.visibility="visible";
}
/* Change font size */
font={def:'12px',curr:12}
font.change=function (num){
	fs = dl.el('changeFont').style;
	fs.fontSize = (num)?this.curr+num+'px':this.def;
	this.curr = parseInt(fs.fontSize);
}
/* mainMenu over 
function menuOver(){
	var menuPics=dl.el('mainMenu').getElementsByTagName('img');
	for(i=0;i<menuPics.length;i++)
	{	pic=menuPics[i];
		pic.onmouseover=function(){if(!this.className.match("curr"))this.src=this.src.replace(/.jpg/,"A.jpg");}
		pic.onmouseout=function(){if(!this.className.match("curr"))this.src=this.src.replace(/A.jpg/,".jpg");}
	} 
}
*/
/* Equal email values */
function subm(frmId,errMess){
	var frm = dl.el(frmId);
	var eml = dl.el('eml');
	var emlConf = dl.el('emlConf');
	//if(eml.value!=''){
		if(eml.value==emlConf.value) {
			emlConf.className=emlConf.className.replace(/(active|error)?$/,(' '));
			emlConf.attr('err',"0");
			emlConf.attr('errorr',"");
		} else {
			emlConf.className=emlConf.className.replace(/(active|error)?$/,(' error'));
			emlConf.attr('err',"1");
			emlConf.attr('errorr',errMess);
		}
	//}
	window.submit(frmId);
}
loc = {request:false}
loc.load = function(region, province) {
	var par = '?region='+region+'&time='+dl.gmt();
	var el = dl.d.getElementById('province');
		el.options[el.options.selectedIndex].innerHTML = "Loading...";
	if(this.request && this.request.abort)
		this.request.abort();
	this.request = new http('location','/ajaxLocations.php'+par).ondata = function() {
//		alert(this.req.responseText);
		var el = dl.d.getElementById('province');
		if(dl.is.ie) { 
			dl.d.getElementById('province').outerHTML = '<select id="province" name="provinceId">'+this.req.responseText+'</select>';
		} else {
			el.innerHTML = this.req.responseText;	
			el.blur();
		}
		if(province)
			dl.d.getElementById('province').value=province;
		loc.request = false;
	}
}



