function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") &&
       anchor.getAttribute("rel") == "external")
     anchor.target = "_blank";
 }
}
function mklogout(formForum)
{

    xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		alert ("Your browser does not support AJAX!");
		return;
	}
	if(formForum) var relatePath = '../';
	var url = 'mklogout.php';
	if(formForum) url = relatePath+url;
	var param="";
	xmlHttp.onreadystatechange = function (){
    	if (xmlHttp.readyState==4 || xmlHttp.readyState==200)
    	{
            var xmlHttpC=GetXmlHttpObject();
        	var urlClear="forum/member.php?action=clearcookies&formhash=wwwkigncar&nowTime="+ new Date().getTime();                                                                                                                                                                                                                       	
            
        	xmlHttpC.open("GET",urlClear,true);
        	xmlHttpC.send();                                
                      
    
            xmlHttpC.onreadystatechange = function (){ 
            	if (xmlHttpC.readyState==4 || xmlHttpC.readyState==200)
            	{                
            	       if(formForum)
                        location.href=relatePath+'home.php';            	       
            	       else
                        location.href='home.php';
                }
            }         	   
    	   //window.location="home.php";
    	}
	};
	xmlHttp.open("POST",url,true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", param.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(param);
}
function setimg(id)
{
xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null){
		alert ("Your browser does not support AJAX!");
		return;
	}
	var url = 'setvdo.php';
	var param = "vid=" + id ;
//alert(param)
	xmlHttp.onreadystatechange = function (){
						if (xmlHttp.readyState==4 || xmlHttp.readyState==200)
						{
						var MessageToggleStatus = xmlHttp.responseText;	
						
						var strarr=MessageToggleStatus.split("^");
						// var str='<h3><a href="#" >'+strarr[3]+'<br />'+strarr[4]+'</a></h3><div><div id="newsmv"></div></div>'+strarr[1]';
var strve="<object width='266' height='215'><param name='movie' value='"+strarr[2]+"'></param><param name='allowFullScreen' value='true'></param><param name='allowscriptaccess' value='always'></param><embed src='"+strarr[2]+"' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='266' height='215'></embed></object>";

 document.getElementById("news3").innerHTML="<h3>"+strarr[3]+"<br>"+strarr[4]+"</h3><div>"+strve+"</div>"+strarr[1];
//alert(strve);

						}
						};
	xmlHttp.open("POST",url,true);
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", param.length);
	xmlHttp.setRequestHeader("Connection", "close");
	xmlHttp.send(param);
}
function GetXmlHttpObject()
{
	var xmlHttp=null;
	try
	{
		xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	try
	{
		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	}
	catch (e)
	{
		xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	}

	return xmlHttp;
}

window.onload = externalLinks;
