// JavaScript Document
// window load event
function addLoadEvent(func){
	var oldonload = window.onload;
	if(typeof window.onload != 'function'){
		window.onload = func;
	} else {
		window.onload = function(){
			oldonload();
			func();
		}
	}
}
/*
function dyniframesize(iframename) {  
	var pTar = null;  

	if (document.getElementById){  
		pTar = document.getElementById(iframename);  
	}else{
		eval('pTar = ' + iframename + ';');  
	}  

	if (pTar && !window.opera){  
		pTar.style.display="block";
		if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight){  
			pTar.height = pTar.contentDocument.body.offsetHeight+FFextraHeight;
		}else if (pTar.Document && pTar.Document.body.scrollHeight){
			pTar.height = pTar.Document.body.scrollHeight;
		}
	}
}

function autoheight(sid){var gid=document.getElementById(sid);
   gid.height=document.documentElement.offsetHeight-5;}
   window.setInterval("autoheight(\"frame_content\")",100);
}

function SetWinHeight(obj){
	var win=obj;
	if (document.getElementById){
		if (win && !window.opera){
			if (win.contentDocument && win.contentDocument.body.offsetHeight)	
				win.height = win.contentDocument.body.offsetHeight;
			else if(win.Document && win.Document.body.scrollHeight)
				win.height = win.Document.body.scrollHeight;
	   }
	}
}
*/
function checkthis()
{	
	var form1=document.getElementById('form1');
    var result1=form1.email.value;
	var result2=form1.message.value;
	var email=form1.email;
	var email_F=form1.email.value.indexOf("@",0)
    if(result1=="Your Email" || result2=="Your Message"){alert ("Your email and message are necessary! Please check it.");return false;}
	if(email_F < 1){alert ("Please enter a valid email address."); email.select(); return false}
    return true;
}
//addLoadEvent(SetWinHeight('frame_content'));

function getHTTPObject(){
	var http;
	var browser = navigator.appName;
	if(browser == "Microsoft Internet Explorer") { http = new ActiveXObject("Microsoft.XMLHTTP"); }
	else{ http = new XMLHttpRequest(); }
	return http;
}
// load information
function loadnews(ID){
	var ID='news'+ID;
	var obj=document.getElementById(ID);
	var ajax = getHTTPObject();
	var url="news/"+ID+".php";
	//alert(url);
	ajax.open("GET", url, true);
	ajax.onreadystatechange = function(){
		if(ajax.readyState==1){obj.innerHTML = "Loading...";}
		if (ajax.readyState == 4 && ajax.status == 200){
			obj.innerHTML = ajax.responseText;
		}
	}
	ajax.send(null);
}
