var root = "http://www.backendcode.com/";
var load_img = "<img src='"+root+"images/loading.gif' border='0'>";

function dynamic_js(box,str,vid_id){
		
	xmlHttp = ajaxOBJ();
	url="ajax.php?action="+str+"&vid_id="+vid_id;
	var newURL = url; 
	xmlHttp.onreadystatechange=function(){
	 if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
	 
	  document.getElementById(box).innerHTML=xmlHttp.responseText;	   
	 }else{
       document.getElementById(box).innerHTML = load_img; 
	 }
	}
	xmlHttp.open("GET",newURL,true);
	xmlHttp.send(null);
}

function show_cart(){
	
	xmlHttp = ajaxOBJ();
	url="ajax.php?action=show_cart";
	var newURL = url; 
	xmlHttp.onreadystatechange=function(){
	 if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){ 
	 
	  document.getElementById('cart').innerHTML=xmlHttp.responseText;	   
	 }else{
       document.getElementById('cart').innerHTML = load_img; 
	 }
	}
	xmlHttp.open("GET",newURL,true);
	xmlHttp.send(null);
	 
}

function del(url,action){
	if(confirm('You are about to delete clip!')){
		location.href=url;
	}
}



function pop_demo(str,w,h){
	window.open(str,
	"mywindow","location=1,status=1,scrollbars=1,width="+w+",height="+h+",top=240,left=550,resizable=1");
}



function span_rec(str){
	
	if(str=="aud"){
	 document.getElementById('vid').style.display='none';
	}else{	
	 document.getElementById('aud').style.display='none';
	}
	
	var chk = document.getElementById(str).style.display;
	if(chk=="block"){
	 document.getElementById(str).style.display='none';		
	}else{
     document.getElementById(str).style.display='block';			 
	}
}



function getCSSID(getID,second){
var str;
	 document.getElementById(getID).style.borderTop='1px solid black';
	 document.getElementById(getID).style.borderLeft='1px solid black';
	 document.getElementById(getID).style.borderRight='1px solid black';
	 document.getElementById(getID).style.borderBottom='1px solid white';
	 document.getElementById(getID).style.backgroundColor='white';
	 document.getElementById(second).style.color='red';
}





function whichBrs() {
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf("opera") != -1) return 'Opera';
if (agt.indexOf("staroffice") != -1) return 'Star Office';
if (agt.indexOf("webtv") != -1) return 'WebTV';
if (agt.indexOf("beonex") != -1) return 'Beonex';
if (agt.indexOf("chimera") != -1) return 'Chimera';
if (agt.indexOf("netpositive") != -1) return 'NetPositive';
if (agt.indexOf("phoenix") != -1) return 'Phoenix';
if (agt.indexOf("firefox") != -1) return 'Firefox';
if (agt.indexOf("safari") != -1) return 'Safari';
if (agt.indexOf("skipstone") != -1) return 'SkipStone';
if (agt.indexOf("msie") != -1) return 'Internet Explorer';
if (agt.indexOf("netscape") != -1) return 'Netscape';
if (agt.indexOf("mozilla/5.0") != -1) return 'Mozilla';
if (agt.indexOf('\/') != -1) {
if (agt.substr(0,agt.indexOf('\/')) != 'mozilla') {
return navigator.userAgent.substr(0,agt.indexOf('\/'));}
else return 'Netscape';} else if (agt.indexOf(' ') != -1)
return navigator.userAgent.substr(0,agt.indexOf(' '));
else return navigator.userAgent;
}




function ajaxOBJ(){
  var xmlHttp;
  try{
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
	}catch (e){
    // Internet Explorer
    try{
      	xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }catch (e){
      	try{
        	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        }catch (e){
        	alert("Your browser does not support AJAX!");
        	return false;
       	}
      }
   }
   return xmlHttp;
}

