function changeheader(val){
    if (val == 1){
        document.getElementById("yt_r").style.display = "inline";
        document.getElementById("blog_r").style.display = "none";
        mapobj = document.getElementById('mapid');
        mapobj.innerHTML = '<img src="/images/newskin/video.png" width="216" height="29" border="0"  alt="" usemap="#map1"/>' +
                            "<map name='map1'>" + 
                            '<AREA SHAPE="RECT" COORDS="108,0,216,29" HREF="javascript:void(0)" onclick="changeheader(2);return 0;"></map>';
    }
    if (val == 2){
        document.getElementById("blog_r").style.display = "inline";
        document.getElementById("yt_r").style.display = "none";
        mapobj = document.getElementById('mapid');
        mapobj.innerHTML = '<img  src="/images/newskin/blogs.png" width="216" height="29" border="0" alt="" usemap="#map2"/>' +
                            "<map name='map2'>" + 
                            '<AREA SHAPE="RECT" COORDS="0,0,108,29" HREF="javascript:void(0)" onclick="changeheader(1);return 0;"></map>';
    }
    
}

function do_search(vala){
   // alert(1);
   
    var tmp = "";
    var goahead = "no";
    var married = "FQXakr1A4ew";
    var interview = "4GViI1h6x5s ";
    var dirty = "tWASFklA-is";
    dwords = ["ANAL", "ANUS", "ASS", "BEASTIALITY", "BISEXUAL", "BLOWJOB", "BONDAGE","BONER","BREAST",
				"CLIT" ,"CLITORIS",  "COCK",  "CUM",  "CUNT",  "DICK",  "DONG", "EROTIC",  "FUCK", "GAY",
				"HARDON",  "HARD ON",  "INCEST",  "LICK",  "LUST",  "NUDE",  "ORAL",  "PENIS",  "PISS",
				"PLAYBOY",  "PORN",  "PUSS",  "QUEER",  "RECTUM",  "SEX",  "SHIT",  "SLEAZY",  "SLUT",
				"SMUT",  "SOFTCORE",  "SPERM",  "SUCK",  "SWINGERS",  "TIT",  "TITS",  "VIRGIN",  "WHORE",
				"X RATED",  "X-RATED",  "FELLATIO",  "HARDCORE",  "HOOKER",  "HUSTLER",  "INTERCOURSE",
				"KAMA SUTRA",  "KINKY",  "LESBIAN",  "LESBO",  "MASTURBAT",  "NUDIST",  "ORGASM",  "PANTIES",
				"PENTHOUSE",  "PROSTITUT",  "XXX",  "SODOM",  "GOMORRAH","HELL","DAMN","SHIT"] ;
    
    //alert(vala);
    if ((vala.search(/you/i) >= 0 || vala.search(/andrew/i) >= 0 ) && (vala.search(/available/i) >= 0  || vala.search(/single/i) >= 0 ) || vala.search(/married/i) >= 0){
     goahead = married;
    //alert("married");
    }else if ( ( vala.search(/you/i) >= 0 || vala.search(/andrew/i) >= 0  ) && (vala.search(/about/i) >= 0  || vala.search(/interview/i) >=0 )){
        goahead = interview;
       // alert("interview");
    }else {
        for (var i = 0; i< dwords.length; i++){
            tmp = vala.toUpperCase();
            if (tmp.search(dwords[i]) >= 0){
		goahead = dirty;
                //alert("found");
		break;  
            }
        }
       //alert("b");
    }
    //alert("pass");
    if (goahead != "no"){
       // alert("pass1");
        fscall(goahead);
        goahead = "no";
    }
    else{
       // alert("pass2");
    var val = encodeURI(vala);
    var xmlHttp=null;
    try	{
        xmlHttp=new XMLHttpRequest();  }// Firefox, Opera 8.0+, Safari
        catch (e) { 														// Internet Explorer
        	try {		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
			catch (e)	{	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
  		}
	if (xmlHttp==null){ alert("Your browser does not support AJAX!"); exit; } 
    else {   	//alert("sending query string = " + val);
        myurl = 'do_yt_s.php?text=' + val;
	xmlHttp.open("GET", myurl, true);
        xmlHttp.onreadystatechange =  function (){ 
	if (xmlHttp.readyState == 4 && xmlHttp.status == 200 ){ 
            q_result = xmlHttp.responseText;
            r_arr = q_result.split("+END+");
        	//alert(q_result);
            document.getElementById('yt_r').innerHTML = r_arr[0];
            //alert(show_tips);
	    //alert(r_arr[1]);
	    if (typeof(r_arr[1]) != "undefined" && show_tips_found == 1){
		
		if (r_arr[1] == "YES"){
		    fscall("-i7AlLHQeL8");
		}else if (r_arr[1] == "NO"){
		    fscall("cHv_DCvOZ74");
		}else{;}
		show_tips_found = 2;
            }else{
		if (typeof(r_arr[1]) != "undefined" && show_tips_notfound == 1){
		
		if (r_arr[1] == "YES"){
		    fscall("-i7AlLHQeL8");
		}else if (r_arr[1] == "NO"){
		    fscall("cHv_DCvOZ74");
		}else{;}
		show_tips_notfound = 2;
            }
	    }
	}
    }
        xmlHttp.send(null);
    }
}}

function js_media_index(vala){
        var val = encodeURI(vala);
    var xmlHttp=null;
    try	{
        xmlHttp=new XMLHttpRequest();  }// Firefox, Opera 8.0+, Safari
        catch (e) { 														// Internet Explorer
        	try {		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
			catch (e)	{	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
  		}
	if (xmlHttp==null){ alert("Your browser does not support AJAX!"); exit; } 
    else {   	//alert("sending query string = " + val);
        myurl = 'do_yt_s.php?text=' + val;
	xmlHttp.open("GET", myurl, true);
        xmlHttp.onreadystatechange =  function (){ 
	if (xmlHttp.readyState == 4 && xmlHttp.status == 200 ){ 
            q_result = xmlHttp.responseText;
            r_arr = q_result.split("+END+");
        	//alert(q_result);
            document.getElementById('yt_r').innerHTML = r_arr[0];
	}
    }
        xmlHttp.send(null);
    }
    
}

function goto_page(pageNum, seachTerm){
    //divobj = document.getElementById("yt_r");
    //divobj.innerHTML = val;
    var val = "page=" + pageNum + "&st=" + encodeURI(seachTerm);

    var xmlHttp=null;
    try	{
        xmlHttp=new XMLHttpRequest();  }// Firefox, Opera 8.0+, Safari
        catch (e) { 														// Internet Explorer
        	try {		xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
			catch (e)	{	xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
  		}
	if (xmlHttp==null){ alert("Your browser does not support AJAX!"); exit; } 
    else {   	//alert("sending query string = " + val);
        myurl = 'do_yt_s.php?' + val;
	xmlHttp.open("GET", myurl, true);
        xmlHttp.onreadystatechange =  function (){ 
	if (xmlHttp.readyState == 4 && xmlHttp.status == 200 ){ 
            q_result = xmlHttp.responseText;
        	//alert(q_result);
            document.getElementById('yt_r').innerHTML = q_result;
	}
    }
        xmlHttp.send(null);
    }
}


function stripslashes(str) {
str=str.replace(/\'/g,"'");
str=str.replace(/\"/g,'"');
return str;
}





