function getOption(UrlName,type,val){ 
		var IdVal = val;
		if(type=='abuse'){
				xmlhttpPost(UrlName+"?file_id="+IdVal,'abuse',IdVal);
		}
		if(type=='abuseAction'){
				xmlhttpPost(UrlName+"?file_id="+IdVal,'abuseAction',IdVal);
		}	
		if(type=='play'){
				xmlhttpPost(UrlName+"?file_id="+IdVal,'play',IdVal);
		}
		if(type=='show_upload_frm') {
				xmlhttpPost(UrlName,'show_upload_frm',IdVal);
		}
}
function xmlhttpPost(strURL,type,val) {
    var xmlHttpReq = false;
    var self = this;
    // Mozilla/Safari
    if (window.XMLHttpRequest) {
        self.xmlHttpReq = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('POST', strURL, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText, type);
        }
    }
    self.xmlHttpReq.send(getquerystring(type,val));
}

function getquerystring(type,val){
	if(type == 'abuse'){
		qstr = 'type=' + escape(type) + '&Val=' + escape(val);
	}
	if(type == 'abuseAction'){
		qstr = 'type=' + escape(type) + '&Val=' + escape(val);
	}
	if(type == 'play'){
		qstr = 'type=' + escape(type) + '&Val=' + escape(val);
	}
	if(type == 'show_upload_frm'){
		qstr = 'type=' + escape(type) + '&Val=' + escape(val);
	}
return qstr;
}
function updatepage(str,type){
//alert(str);
if(type == 'abuse'){
			if(str==1){
				document.getElementById("ajaxPanel").innerHTML = 'Violation Reported Successfully';
			}
			else{
				document.getElementById("ajaxPanel").innerHTML = str;
			}
		}
if(type == 'abuseAction'){
			if(str==1){
				document.getElementById("ajaxPanel").innerHTML = 'Violation Reported Successfully';
			}
			else if(str==2){
				document.getElementById("ajaxPanel").innerHTML = 'Failure in Violation Report';			
			}else{
				document.getElementById("ajaxPanel").innerHTML = str;
			}
		}
if(type == 'play'){
			document.getElementById("player").innerHTML = str;
		}
if(type == 'show_upload_frm'){
			document.getElementById("uploadtd").innerHTML = str;
		}
}


