// JavaScript Document
/**
* creating the object for http request
*
**/
function makeObject(){
	var x;
	if (window.ActiveXObject) {
		x = new ActiveXObject("Microsoft.XMLHTTP");
	}else if (window.XMLHttpRequest) {
		x = new XMLHttpRequest();
	}
	return x;
}
var request = makeObject();





/**
* Function : ajaxCategorieslist
* Used for generating the categories list in xml file
**/
function ajaxVideoCount(id){
	var action = "http://watch.supermodelme.tv/wp-content/themes/smm_theme/videocount.php?videoid="+id;	
	//alert("action:"+action);
	request.open("GET", action, true);
	request.onreadystatechange = function() {	
		if(request.readyState == 4 && request.status == 200) {
			var answer = request.responseText;	
			//alert(answer);		
			//var answerarray = answer.split("###");			
		}
	}
	request.send(null);	
	//return false;
}

/**
* Function : ajaxVideoRatings
* Used for generating the categories list in xml file
**/
function ajaxVideoRatings(id,ratingvalue){
	//var id = "videoid=http://watch.supermodelme.tv/wp-content/videos/week1/adeline.mp4";
	//var rating_value = "4";
	var action = "http://watch.supermodelme.tv/wp-content/themes/smm_theme/video_ratings.php?videoid="+id+"&rating_value="+ratingvalue;	
	//alert("action:"+action);
	request.open("GET", action, true);
	request.onreadystatechange = function() {	
		if(request.readyState == 4 && request.status == 200) {
			var answer = request.responseText;	
			//alert(answer);		
			//var answerarray = answer.split("###");			
		}
	}
	request.send(null);	
	//return false;
}


/**
* Function : ajaxVideoRatings
* Used for generating the categories list in xml file
**/
function ajaxVideoCommentsList(id){
	//var id = "videoid=http://watch.supermodelme.tv/wp-content/videos/week1/adeline.mp4";
	//var rating_value = "4";
	var action = "http://watch.supermodelme.tv/wp-content/themes/smm_theme/commentslist.php?videoid="+id;	
	//alert("action:"+action);
	request.open("GET", action, true);
	request.onreadystatechange = function() {	
		if(request.readyState == 4 && request.status == 200) {
			var answer = request.responseText;	
			//alert(answer);		
			//var answerarray = answer.split("###");			
		}
	}
	request.send(null);	
	//return false;
}


