IMDB movie subtitles

By hosts Last update Jan 22, 2009 — Installed 3,556 times. Daily Installs: 7, 9, 5, 8, 3, 9, 2, 6, 7, 5, 1, 12, 8, 8, 17, 4, 15, 11, 12, 12, 22, 36, 30, 35, 13, 15, 13, 24, 11, 20, 19, 17

There are 11 previous versions of this script.

Add Syntax Highlighting (this will take a few seconds, probably freezing your browser while it works)

// ==UserScript==
// @name           IMDB movie subtitles
// @namespace      http://userscripts.org/scripts/show/21965
// @description    Searching for greek , turkish, english and arabic subtitles for movies listed on IMDB.com
// @version        22012009
// @license        GNU GPL version 3 or later; http://www.gnu.org/copyleft/gpl.html
// @include        http://*imdb.com/title/tt*
// ==/UserScript==

// New Additions version 22012009
// Arabic language is supported now
//----------------------------------
// New Additions version 18012009
// Turkish and English languages are supported now
//----------------------------------
// New Additions version 15122008
// http://www.greeksubs.ws/ correction
//----------------------------------
// New Additions version 13112008 EPOE FACK edition
// http://www.greeksubs.ws/
//----------------------------------
// New Additions version 07112008 EPOE FACK edition
// http://subs4free.com/
// http://dvd.stuff.gr/
// http://www.all4divx.com/
// http://www.divxsubtitles.net/
//---------------------------------- 
// History
// Previous version 09092998
//----------------------------------

// To Do ?
// http://www.tvsubtitles.net/
// http://www.movieplace.tv/subtitles.php?search_b=GOMORRA+&search=
//var lang = GM_getValue("language");
//alert (lang);
//if (lang == undefined){
//	alert (lang);
//	}

////if ((GM_getValue("language")) || isNaN(parseInt(GM_getValue("xposit")) != "NaN")){
////if (!(isNaN(GM_getValue("language")))){
//if (isNaN(GM_getValue("language"))){
if (GM_getValue("language") == undefined){
configuration();
return;
	}	


	function configuration(){
	//GM_setValue("xposit", xposit);
	//alert('set lang');
		var node = document.createElement("div");
	node.setAttribute("id", "configuration_layer");

node.innerHTML ="<h1>imdb subtitles configuration</h1>";
	
node.innerHTML += "In what language? / "+ 
	                "Σε τι γλώσσα;<br>";  
	                
node.innerHTML += "<div id=subsconfig>"+	                 
                  "<img src='http://www.all4divx.com/flags/84.png'><input type='radio' name='language' value='greek'> Ελληνικά<br>"+
                  "<img src='http://www.all4divx.com/flags/223.png'><input type='radio' name='language' value='turkish'> Türkçe<br>"+
                  "<img src='http://www.all4divx.com/flags/230.png'><input type='radio' name='language' value='english'> English<br>"+
                  "<img src='http://www.all4divx.com/flags/192.png'><input type='radio' name='language' value='arabic'> Arabic<br>"+
                  "</div>";
                  
var existingobject = document.getElementsByTagName("body");

existingobject[0].parentNode.insertBefore(node,existingobject[0]);	
//GM_addStyle("div#configuration_layer {background-color:black;-moz-border-radius:7px;color:white;font-family:Arial,Helvetica,sans-serif;font-size:14px;height:auto;left:118px;padding-bottom:23px;padding-left:10%;padding-right:10%;padding-top:10px;position:fixed;top:47px;width:auto;z-index:101;}");
GM_addStyle("div#configuration_layer {-moz-border-radius:7px;background:#FFFFCC url(/images/nb15/searchbg.gif) repeat-x scroll center bottom;color:black;font-family:Arial,Helvetica,sans-serif;font-size:14px;height:auto;left:118px;padding:10px 36px 23px;position:fixed;top:47px;width:auto;z-index:101;}");
	
	function radiofunctionchange(evt){
		var lang = evt.target.value;
		GM_setValue("language", lang);
		GM_addStyle("div#configuration_layer {display:none;}");
		}
document.getElementById("subsconfig").addEventListener("change", radiofunctionchange, false);

	}
	
                

var whatlang = GM_getValue("language");
var the_text = new Array();
if (whatlang == 'greek'){
the_text[0] = "IMDB subtitles - Αλλαγή στην θέση του κουτιού με τους Ελληνικούς υπότιτλους";
the_text[1] = "IMDB subtitles - Αναζήτηση με εναλακτικό όνομα υπότιτλου";
the_text[2] = "Κινήστε το αργά, κάντε κλίκ για αποθήκευση θέσης";
the_text[3] = "Ελληνικοί Υπότιτλοι για : ";
the_text[4] = "Ελληνικοί Υπότιτλοι";
the_text[5] = "Η νέα θέση αποθηκεύτηκε";
the_text[6] = "από αριστερά";
the_text[7] = "από πάνω";
the_text[8] = "IMDB subtitles - Configuration";	
the_text[9] = "http://www.all4divx.com/flags/84.png"; // greek flag
subs_box_width = "146px";
}else if(whatlang == 'turkish'){
the_text[0] = "IMDB subtitles - Türkçe altyazı arama kutucuğunun yerini değiştir";
the_text[1] = "IMDB subtitles - Alternatif isimlerinde ara";
the_text[2] = "Yavaşça hareket ettir, kayıt etmek için tıkla ";
the_text[3] = "Türkçe Altyazılarda ara : ";
the_text[4] = "Türkçe Altyazı";
the_text[5] = "Yeni pozisyon kayıt edildi";
the_text[6] = "soldan";
the_text[7] = "yukarıdan";	
the_text[8] = "IMDB subtitles - Ayarlar";
the_text[9] = "http://www.all4divx.com/flags/223.png";	// turkish flag
subs_box_width = "131px";
}else if(whatlang == 'arabic'){
the_text[0] = "IMDB subtitles - Change the position of the box with Arabic subtitles";
the_text[1] = "IMDB subtitles - Search with alternative name";
the_text[2] = "Move it slowly, click to save position";
the_text[3] = "Arabic Subtitles for : ";
the_text[4] = "Arabic Subtitles";
the_text[5] = "New position is saved";
the_text[6] = "from the left";
the_text[7] = "from the top";	
the_text[8] = "IMDB subtitles - Configuration";	
the_text[9] = "http://www.all4divx.com/flags/192.png";	// arabic flag
subs_box_width = "132px";
}else if(whatlang == 'english'){
the_text[0] = "IMDB subtitles - Change the position of the box with English subtitles";
the_text[1] = "IMDB subtitles - Search with alternative name";
the_text[2] = "Move it slowly, click to save position";
the_text[3] = "English Subtitles for : ";
the_text[4] = "English Subtitles";
the_text[5] = "New position is saved";
the_text[6] = "from the left";
the_text[7] = "from the top";	
the_text[8] = "IMDB subtitles - Configuration";	
the_text[9] = "http://www.all4divx.com/flags/230.png";	// english flag
subs_box_width = "132px";
}else{
		configuration();
		return;
}



var rootlength=document.getElementsByTagName("div");
function alternativetitle(){
for (i=0; i<rootlength.length; i++){

if (rootlength[i].className=="info"){

if (rootlength[i].innerHTML.match(/English title|\(USA\)\(/)){

for (y=0; rootlength[i].childNodes.length; y++){
	
	if (rootlength[i].childNodes[y].textContent.match(/English title|\(USA\)/)){
		var engishTitle = rootlength[i].childNodes[y].textContent;
		engishTitle = engishTitle.replace(/\(.*?\)/g,"");
		return engishTitle;
		
	        }
	      }
      }
    }
  }
}



getthosesubs(1);







function getthosesubs(vipx){
	
if ((document.getElementById('tn15crumbs')) && (window == top)) {

GM_registerMenuCommand(the_text[0], function(){change_box_position();});
GM_registerMenuCommand(the_text[1], function(){new_name_search();});
GM_registerMenuCommand(the_text[8], function(){configuration();});

  function new_name_search(){
  	removeDaBox = document.getElementById('subs_box')
    removeDaBox.parentNode.removeChild(removeDaBox);  	
  	getthosesubs(3);
  }  	
  
  function change_box_position(){
  	removeDaBox = document.getElementById('subs_box')
    removeDaBox.parentNode.removeChild(removeDaBox);  	
  	getthosesubs(2);
  }


	if (!(isNaN(GM_getValue("xposit")))){
    var xposit = GM_getValue("xposit");
    var yposit = GM_getValue("yposit");
   }else{
    var	xposit = 806;
    var yposit = 108;
    GM_setValue("xposit", xposit);
    GM_setValue("yposit", yposit);
	 };

  function bakeValue(name,value,days) {
	  GM_setValue(name, value);
  }
		
  var mybox = document.createElement("div");



if (vipx == 2){
    mybox.innerHTML = '<div  id="subs_box" style="left: '+parseInt(xposit)+'px; top: '+parseInt(yposit)+'px; margin: 5px; padding: 5px; overflow: hidden; -moz-border-radius: 10px; position: absolute; width: 175px; opacity: 0.7; z-index: 100; height: 12px; font-size: 8pt; font-weight: bold; font-family: arial,sans-serif; background-color: rgb(243, 238, 173);">'+
                      '<span title="'+the_text[2]+'"  style="-moz-border-radius:10px; background-color:white; border-color:yellow; position: absolute; top: 2px; height: 16px; border-style:groove; border-width:1px; width: 16px; left: 5px;"  border="2" cellspacing="1" cellpadding="1" >&nbsp;'+
                      '<span id="aplog2o" style="cursor:move" width="100%" ></span>'+
                      '</span>'+ 
                    	'<span id="aplogo" style="height:12px; width:18px; left:27px; background-image: url('+the_text[9]+'); position: inherit;">&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;'+
                    	'</span>'+
    	               	'<span  style="left:57px; position:absolute;  top:-5; width:200px; cursor: pointer;">'+the_text[4]+'</span>'+
    	               	'<p id="sub_results"/>'+
                      '</div>';

 function listenToList(e){
    offsetx=e.clientX;
    offsety=e.clientY;
    nowX=document.getElementById("subs_box").style.left;
    nowX = nowX.replace(/px/i,"");
    offsety = offsety.toString(10) + 'px';
    lefti = parseInt(e.clientX)-18;
    topi = parseInt(e.clientY)-18;
    moveit(lefti,topi);
  } 

function saveToList(e){
    aLIx = document.getElementById("subs_box").style.left;
    aLIx = aLIx.replace(/px/i,"");
    aLIy = document.getElementById("subs_box").style.top;
    aLIy = aLIy.replace(/px/i,"");    	
    
bakeValue('xposit', aLIx); 	
bakeValue('yposit', aLIy); 
//alert("Η νέα θέση αποθηκεύτηκε\n\nαπό αριστερά = "+aLIx +"px\nαπό πάνω = "+aLIy+"px");
alert(the_text[5]+"\n\n"+the_text[6]+" = "+aLIx +"px\n"+the_text[7]+" = "+aLIy+"px");
}


addEventHandler(mybox.firstChild.firstChild, "mousemove", listenToList , true);
addEventHandler(mybox.firstChild.firstChild, "click", saveToList , true);                      

}else if(vipx == 3){
	the_alternativetitle = alternativetitle();
    mybox.innerHTML = '<div  id="subs_box" style="left: '+xposit+'px; top: '+yposit+'px; margin: 5px; padding: 5px; overflow: hidden; -moz-border-radius: 10px; position: absolute; width: 274px; opacity: 0.7; z-index: 100; height: 12px; font-size: 8pt; font-weight: bold; font-family: arial,sans-serif; background-color: rgb(243, 238, 173);">'+
                      '<span id="aplogo" style="height:12px; width:18px; left:12px; background-image: url('+the_text[9]+'); position: inherit;">&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;'+
                    	'</span>'+
    	               	'<span  style="left:36px; position:absolute;  top:-5; width:auto; cursor: pointer;">'+the_text[3]+'</span>'+
    	               	'<input style="top:2px; left:172px; font-size:0.8em; height:10px; position:absolute;  top:-5; width:96px; cursor: cell;" id="searchquery" type="text" title="Search" value="'+the_alternativetitle+'" maxlength="2048" size="41" name="q"/>'+ 
                    	'<p id="sub_results"/>'+
                      '</div>';

	
	}
	else{
    mybox.innerHTML = '<div  id="subs_box" style="left: '+xposit+'px; top: '+yposit+'px; margin: 5px; padding: 5px; overflow: hidden; -moz-border-radius: 10px; position: absolute; width: '+subs_box_width+'; opacity: 0.7; z-index: 100; height: 12px; font-size: 8pt; font-weight: bold; font-family: arial,sans-serif; background-color: rgb(243, 238, 173);">'+
                    	'<span id="aplogo" style="height:12px; width:18px; left:12px; background-image: url('+the_text[9]+'); position: inherit;">&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;'+
                    	'</span>'+
    	               	'<span  style="left:36px; position:absolute;  top:-5; width:200px; cursor: pointer;">'+the_text[4]+'</span>'+
    	               	'<p id="sub_results"/>'+
                      '</div>';
}



 
                       

function moveit(lefti,topi){
	document.getElementById("subs_box").style.left=lefti+'px'; 
	document.getElementById("subs_box").style.top=topi+'px';
	return;
}	


if(vipx == 3){
    addEventHandler(mybox.firstChild.childNodes[1], "click",
 			function() {
				var box = document.getElementById('subs_box');
				if (box.style.height.split('px')[0]<250 ) {
					box.style.height = 'auto';
					box.style.minWidth = '269px';
					box.style.minHeight = '12px';
					box.style.opacity  = '1';
					box.style.setProperty( "background-color", "#F7F3C5", "" );
					box.style.width = 'auto';
					box.style.overflowX = 'hidden';
				  box.style.overflowY = 'auto';
				  box.childNodes[1].style.setProperty( "font-style", "oblique", "" );
				  //box.childNodes[1].style.setProperty( "text-align", "center", "" );				  
				} else{
					box.style.height = 12 + 'px';
					//+box.style.width = '146px';
					box.style.opacity  = '0.7';
					box.style.setProperty( "background-color", "#F3EEAD", "" );
					box.childNodes[1].style.setProperty( "font-style", "normal", "" );
					
					//box.childNodes[1].style.setProperty( "text-align", "justify", "" );
					box.style.overflow = 'hidden';
				}
			
			var gotitonce = document.getElementById('flag_gr2');
			//if (!gotitonce){
				

  var search_query = mybox.firstChild.childNodes[2].value;

				getresults_for_grsubs(search_query);
				//}	

		  }
		, true);
	}else{   
    
		addEventHandler(mybox.firstChild.lastChild.previousSibling, "click",
			function() {
				var box = document.getElementById('subs_box');
				if (box.style.height.split('px')[0]<250 ) {
					box.style.height = 'auto';
					box.style.minWidth = subs_box_width;
					box.style.minHeight = '12px';
					box.style.opacity  = '1';
					box.style.setProperty( "background-color", "#F7F3C5", "" );
					box.style.width = 'auto';
					box.style.overflowX = 'hidden';
				  box.style.overflowY = 'auto';
				  box.childNodes[1].style.setProperty( "font-style", "oblique", "" );
				  //box.childNodes[1].style.setProperty( "text-align", "center", "" );				  
				} else{
					box.style.height = 12 + 'px';
					box.style.width = subs_box_width;
					box.style.opacity  = '0.7';
					box.style.setProperty( "background-color", "#F3EEAD", "" );
					box.childNodes[1].style.setProperty( "font-style", "normal", "" );
					
					//box.childNodes[1].style.setProperty( "text-align", "justify", "" );
					box.style.overflow = 'hidden';
				}
			
			var gotitonce = document.getElementById('flag_gr2');
			if (!gotitonce){
				getresults_for_grsubs(1);
				}
 	

		  }
		, true);
}

   document.body.insertBefore(mybox, document.body.firstChild);
  }
function addEventHandler(target, eventName, eventHandler)
{
	if (target.addEventListener)
		target.addEventListener(eventName, eventHandler, false);
	else if (target.attachEvent)
		target.attachEvent("on" + eventName, eventHandler);
}
  
//---------------------------------- na  
function getresults_for_grsubs(getresults_for_grsubs){
	
  var regexImdbNum = /\/title\/tt(\d{7})\//;
  var arrImdbNum = regexImdbNum.exec(document.location);
  
  // Check that we got valid results from regex
    if (arrImdbNum && arrImdbNum.length == 2) {
    	imdb_id = arrImdbNum[1];
  	  getOpensubsResults(imdb_id);
  	   }
  	   	

	if (getresults_for_grsubs != '1'){
		var movname = getresults_for_grsubs;
    
    
           if (whatlang == "greek"){
	       	 sentittothegreeksites(movname);  
	       	 }else if(whatlang == "turkish"){
	       	 sentittotheturkishsites(movname); 
	       	 }else if(whatlang == "arabic"){
	       	 sentittothearabicsites(movname); 
	       	 }else if(whatlang == "english"){
	       	 sentittotheenglishsites(movname); 
	       	 }
		
		
    	}else{

    var regexTitle = /(?!".+")^(.+?) \(\d{4}(?:\/[IV]+)?\)/;
    var strTitle = document.getElementsByTagName("title")[0].textContent;
    strTitle = strTitle.replace(/"/g,'')
    var arrResult = regexTitle.exec(strTitle);
    var movname = arrResult[1];
      if (movname && movname.length > 1) {
      	
    
              if (whatlang == "greek"){
	            sentittothegreeksites(movname);  
	            }else if(whatlang == "turkish"){
	           	sentittotheturkishsites(movname); 
	           	}else if(whatlang == "arabic"){
	       	    sentittothearabicsites(movname); 
	       	    }else if(whatlang == "english"){
	       	    sentittotheenglishsites(movname); 
	       	    }
			
    	  	//--- old start ---\\
    	  	//getsubs4u_gr(movname);
    	  	//greeksubs_com(movname);
    	  	//---  old end  ---\\
    	}	
      	
    }
	   
 
function sentittothegreeksites(movname){
		  	getGreekSubtitleProjectResults(movname);
  	  	getsubsgr(movname.replace(/:/g,'').replace(/ /g,'+'));
  	  	subs4free_com(movname.replace(/:/g,'').replace(/ /g,'+'));
  	  	greeksubs_ws(movname.replace(/:/g,'').slice(0,20).toLowerCase());	  	
        dvd_stuff_gr(movname.replace(/:/g,'').replace(/ /g,'+'));
        all4divx_com(movname.replace(/:/g,'').replace(/ /g,'+').replace(/\//g,'+'));
        divxsubtitles_net(movname.replace(/:/g,'').replace(/ /g,'+'));
      }  
      
function sentittotheturkishsites(movname){
       divxforever_in(movname.replace(/:/g,'').replace(/ /g,'+'));
       all4divx_com(movname.replace(/:/g,'').replace(/ /g,'+').replace(/\//g,'+'));
       divxsubtitles_net(movname.replace(/:/g,'').replace(/ /g,'+'));
       turkceltyazi_org(arrImdbNum[1]);
       } 
function sentittotheenglishsites(movname){
       divxforever_in(movname.replace(/:/g,'').replace(/ /g,'+'));
       all4divx_com(movname.replace(/:/g,'').replace(/ /g,'+').replace(/\//g,'+'));
       divxsubtitles_net(movname.replace(/:/g,'').replace(/ /g,'+'));
       }                 
function sentittothearabicsites(movname){
       all4divx_com(movname.replace(/:/g,'').replace(/ /g,'+').replace(/\//g,'+'));
       divxsubtitles_net(movname.replace(/:/g,'').replace(/ /g,'-'));
       subscene_com(movname.replace(/ /g,'+'));
       } 

function subscene_com(moviename){
	var link = document.getElementById('sub_results');

	var subscene = 'http://subscene.com/filmsearch.aspx?q=' + moviename+'&exact=exact';
	// ? OR ? var subscene = 'http://www.subscene.com/index.php?act=subz&CODE=66&mname=' + escape(moviename)+'&subtitle_lang='+subscenelang;
	GM_xmlhttpRequest({
		method: 'GET',
		url: subscene,
    //url: 'http://www.subscene.com/index.php?act=subz&CODE=66&mname=' + moviename,
    headers: {
             'User-agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11',
             'Accept': 'application/atom+xml,application/xml,text/xml',
             },
    onload: function (responseDetails) {
//alert('after Cookie: ' + document.cookie); 
//'Cookie': 'subscene_sLanguageNames=%28Arabic%29',
			if (responseDetails.status == 200) {
				GM_log(responseDetails.responseText);
				var recantfindexactnamergex = new RegExp("Search for Film Title", "g");
				var cantfindexactname = recantfindexactnamergex.exec(responseDetails.responseText);
				
				if (cantfindexactname) {
		link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://subscene.com/favicon.png  width='14' height='12'> <a id='not_flag_gr2' href='"+subscene.replace(/&exact=exact/,'')+"'>Please visit subscene.com</a></span>"; 			
return;		
			}				

	      var re = new RegExp("\" href=\"\/arabic\/", "g");
				var rating = re.exec(responseDetails.responseText);
				if (rating != null) {
				var whoManyResults = responseDetails.responseText.match(/\" href=\"\/arabic\//g);
				
					 if (whoManyResults.length > 0 ) {
 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://subscene.com/favicon.png  width='14' height='12'> <a href='"+subscene+"'>Found "+whoManyResults.length+" subtitles @ subscene.com</a></span>"; 			
           }
				}else{
					link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://subscene.com/favicon.png  width='14' height='12'> <a href='"+subscene+"'>Status "+responseDetails.statusText+" 0 subtitles @ subscene.com</a></span>"; 			
	      }
					

			
     }else{
	 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://subscene.com/favicon.png  width='14' height='12'> <a id='not_flag_gr2' href='"+subscene+"'>"+responseDetails.status+" @ subscene.com</a></span>"; 			
				}
				
		}		
		//}
	});	
	
	}


//turkish version site function start



function divxforever_in(moviename){
	var link = document.getElementById('sub_results');

	if (whatlang == 'english'){
		var divxforeverlang = 'EN';
		}
	else if (whatlang == 'turkish'){
		var divxforeverlang = 'TR';
		}		
	var divxforever = 'http://www.divxforever.in/index.php?act=subz&CODE=66&mname=' + moviename+'&subtitle_lang='+divxforeverlang;
	// ? OR ? var divxforever = 'http://www.divxforever.in/index.php?act=subz&CODE=66&mname=' + escape(moviename)+'&subtitle_lang='+divxforeverlang;
	GM_xmlhttpRequest({
		method: 'GET',
		url: divxforever,
    //url: 'http://www.divxforever.in/index.php?act=subz&CODE=66&mname=' + moviename,
    headers: {
             'User-agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11',
             'Accept': 'application/atom+xml,application/xml,text/xml',
             },
    onload: function (responseDetails) {

			if (responseDetails.status == 200) {
	      var re = new RegExp("lang_", "g");
				var rating = re.exec(responseDetails.responseText);
				if (rating != null) {
				var whoManyResults = responseDetails.responseText.match(/lang_/g);
				
					 if (whoManyResults.length > 0 ) {
 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.divxforever.in/favicon.ico  width='14' height='12'> <a href='"+divxforever+"'>Found "+whoManyResults.length+" subtitles @ divxforever.in</a></span>"; 			
           }
				}else{
					link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.divxforever.in/favicon.ico  width='14' height='12'> <a href='"+divxforever+"'>Status "+responseDetails.statusText+" 0 subtitles @ divxforever.in</a></span>"; 			
	      }
					

			
     }else{
	 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.divxforever.in/favicon.ico  width='14' height='12'> <a id='not_flag_gr2' href='"+divxforever+"'>"+responseDetails.status+" @ divxforever.in</a></span>"; 			
				}
		}
	});	
	
	}

function turkceltyazi_org(movieid){
	var link = document.getElementById('sub_results');
	var turkcealtyaziurl = 'http://www.turkcealtyazi.org/tt'+movieid;
	
	GM_xmlhttpRequest({
		method: 'GET',
    url: turkcealtyaziurl,
    headers: {
             'User-agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11',
             'Accept': 'application/atom+xml,application/xml,text/xml',
             },
    onload: function (responseDetails) {


			if (responseDetails.status == 200) {
	      var re = new RegExp("tr.gif", "g");
				var rating = re.exec(responseDetails.responseText);
				if (rating != null) {
				var whoManyResults = responseDetails.responseText.match(/tr.gif/g);
				
					 if (whoManyResults.length > 0 ) {
 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.turkcealtyazi.org/images/favicon.ico  width='14' height='12'> <a href='"+turkcealtyaziurl+">Found "+whoManyResults.length+" subtitles @ turkcealtyazi.com</a></span>"; 			
           }
				}else{
					link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.turkcealtyazi.org/images/favicon.ico  width='14' height='12'> <a href='"+turkcealtyaziurl+">Status "+responseDetails.statusText+" 0 subtitles @ turkcealtyazi.com</a></span>"; 			
	      }
					

			
     }else{
	 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.turkcealtyazi.org/images/favicon.ico  width='14' height='12'> <a id='not_flag_gr2' href='"+turkcealtyaziurl+">"+responseDetails.status+" @ turkcealtyazi.com</a></span>"; 			
				}
		}
	});	
	
	}

//turkish version site function end

function divxsubtitles_net(moviename){

	if (whatlang == 'greek'){
		var divxsubtitleslang = '11';
		}
	else if (whatlang == 'turkish'){
		var divxsubtitleslang = '22';
		}	
	else if (whatlang == 'english'){
		var divxsubtitleslang = '2';
		}
	else if (whatlang == 'arabic'){
		var divxsubtitleslang = '40';
		}		

	var link = document.getElementById('sub_results');
	GM_xmlhttpRequest({
		method: 'GET',
		//url: 'http://www.divxsubtitles.net/page_searchedsubtitles.php?_language=22&_format=-1&_framerate=-1&_date=-1&nbcd=-1&_grade=-2&_character=-1&_free=' + moviename + '&firstSearch=true&pageNo=1&recPerPage=40',
    
		url: 'http://www.divxsubtitles.net/page_searchedsubtitles.php?_language='+divxsubtitleslang+'&_format=-1&_framerate=-1&_date=-1&nbcd=-1&_grade=-2&_character=-1&_free=' + moviename + '&firstSearch=true&pageNo=1&recPerPage=40',
    headers: {
             'User-agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11',
             'Accept': 'application/atom+xml,application/xml,text/xml',
             },
    onload: function (responseDetails) {


			if (responseDetails.status == 200) {
	      var re = new RegExp("&nbsp;&nbsp;", "g");
				var rating = re.exec(responseDetails.responseText);

				if (rating != null) {
				var whoManyResults = responseDetails.responseText.match(/&nbsp;&nbsp;/g);
				
					 if (whoManyResults.length > 0 ) {
 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.divxsubtitles.net/favicon.ico  width='14' height='12'> <a href='http://www.divxsubtitles.net/page_searchedsubtitles.php?_language="+divxsubtitleslang+"&_format=-1&_framerate=-1&_date=-1&nbcd=-1&_grade=-2&_character=-1&_free="+escape(moviename) + "&firstSearch=true&pageNo=1&recPerPage=40'>Found "+whoManyResults.length+" subtitles @ divxsubtitles.net</a></span>"; 			
           }
				}else{
					link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.divxsubtitles.net/favicon.ico  width='14' height='12'> <a href='http://www.divxsubtitles.net/page_searchedsubtitles.php?_language="+divxsubtitleslang+"&_format=-1&_framerate=-1&_date=-1&nbcd=-1&_grade=-2&_character=-1&_free="+escape(moviename) + "&firstSearch=true&pageNo=1&recPerPage=40'>Status "+responseDetails.statusText+" 0 subtitles @ divxsubtitles.net</a></span>"; 			
	      }
					

			
     }else{
	 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.divxsubtitles.net/favicon.ico  width='14' height='12'> <a id='not_flag_gr2' href='http://www.divxsubtitles.net/page_searchedsubtitles.php?_language="+divxsubtitleslang+"&_format=-1&_framerate=-1&_date=-1&nbcd=-1&_grade=-2&_character=-1&_free="+escape(moviename)+"&firstSearch=true&pageNo=1&recPerPage=40'>"+responseDetails.status+" @ divxsubtitles.net</a></span>"; 			
				}
		}
	});	
	
	}

function all4divx_com(moviename){
	//alert(whatlang);
	  if (whatlang == 'greek'){
		var all4divxlang = 'Greek';
		}
	  else if (whatlang == 'turkish'){
		var all4divxlang = 'Turkish';
		}else if (whatlang == 'english'){
		var all4divxlang = 'English';
		}else if (whatlang == 'arabic'){
		var all4divxlang = 'Arabic';
		}
		

	var link = document.getElementById('sub_results');
	GM_xmlhttpRequest({
		method: 'GET',
    url: 'http://www.all4divx.com/subtitles/' + moviename + '/'+all4divxlang+'/1',
    headers: {
             'User-agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11',
             'Accept': 'application/atom+xml,application/xml,text/xml',
             },
    onload: function (responseDetails) {


			if (responseDetails.status == 200) {
	      var re = new RegExp("movie_row_name_link_1", "g");
				var rating = re.exec(responseDetails.responseText);
				if (rating != null) {
				var whoManyResults = responseDetails.responseText.match(/movie_row_name_link_1/g);
				
					 if (whoManyResults.length > 0 ) {
 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.all4divx.com/favicon.ico  width='14' height='12'> <a href='http://www.all4divx.com/subtitles/"+escape(moviename) + "/"+all4divxlang+"/1'>Found "+whoManyResults.length+" subtitles @ all4divx.com</a></span>"; 			
           }
				}else{
					link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.all4divx.com/favicon.ico  width='14' height='12'> <a href='http://www.all4divx.com/subtitles/"+escape(moviename) + "/"+all4divxlang+"/1'>Status "+responseDetails.statusText+" 0 subtitles @ all4divx.com</a></span>"; 			
	      }
					

			
     }else{
	 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.all4divx.com/favicon.ico  width='14' height='12'> <a id='not_flag_gr2' href='http://www.all4divx.com/subtitles/"+escape(moviename)+"/"+all4divxlang+"/1'>"+responseDetails.status+" @ all4divx.com</a></span>"; 			
				}
		}
	});	
	
	}


function dvd_stuff_gr(moviename){
	var link = document.getElementById('sub_results');

	  GM_xmlhttpRequest({
		method: 'GET',
    url: 'http://dvd.stuff.gr/subtitles/index.php?act=search&ebresi=' + moviename + '&submit=Search',
    headers: {
             'User-agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11',
             'Accept': 'application/atom+xml,application/xml,text/xml',
             },
    onload: function (responseDetails) {

			if (responseDetails.status == 200) {
	      var re = new RegExp("Get\!", "g");
				var rating = re.exec(responseDetails.responseText);
				if (rating != null) {

				var whoManyResults = responseDetails.responseText.match(/Get\!/g);
					 if (whoManyResults.length > 0 ) {
 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://dvd.stuff.gr/pics/tik.gif  width='14' height='12'> <a href='http://dvd.stuff.gr/subtitles/'>Found "+ whoManyResults.length +" subtitles @ dvd.stuff.gr</a></span>"; 			
           }
				}else{
					link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://dvd.stuff.gr/pics/tik.gif  width='14' height='12'> <a href='http://dvd.stuff.gr/subtitles/'>Status "+responseDetails.statusText+" 0 subtitles @ dvd.stuff.gr</a></span>"; 			
	      }
					

			
     }else{
	 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://dvd.stuff.gr/pics/tik.gif width='14' height='12'> <a id='not_flag_gr2' href='http://dvd.stuff.gr/subtitles/'>"+responseDetails.status+"  @ dvd.stuff.gr</a></span>"; 			
				}
		}
	});	
	
	}
	
function greeksubs_ws(moviename){
	var link = document.getElementById('sub_results');
//var grurl = 'http://greeksubs.ws/portal/component/search/' + escape(moviename) +'.html?ordering=newest&searchphrase=all&limit=20&areas[0]=attachments';
var grurl = 'http://greeksubs.ws/component/search/' + escape(moviename) +'.html?ordering=newest&searchphrase=all&limit=20&areas[0]=attachments';
	GM_xmlhttpRequest({
		method: 'GET',
    url: grurl,
    headers: {
             'User-agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11',
             'Accept': 'application/atom+xml,application/xml,text/xml',
             },
    onload: function (responseDetails) {


			if (responseDetails.status == 200) {
	      var re = new RegExp("attachments/download", "g");
				var rating = re.exec(responseDetails.responseText);
				if (rating != null) {
				var whoManyResults = responseDetails.responseText.match(/attachments\/download/g);
	
				//var whoManyResults = responseDetails.responseText.match(/get\.php\?subtitleid/g);
				
					 if (whoManyResults.length > 0 ) {
 link.innerHTML += 
   
"<br><span id='flag_gr2'><img src='http://greeksubs.ws/templates/gk_moxmovies/favicon.ico'  width='14' height='12'> <a href='"+ grurl + "'>Found "+whoManyResults.length+" subtitles @ greeksubs.ws</a></span>"; 			
           }
				}else{
					link.innerHTML += 
"<br><span id='flag_gr2'><img src='http://greeksubs.ws/templates/gk_moxmovies/favicon.ico'  width='14' height='12'> <a href='"+ grurl + "'>Status "+responseDetails.statusText+" 0 subtitles @ greeksubs.ws</a></span>"; 			
	      }
					

			
     }else{
	 link.innerHTML += 
"<br><span id='flag_gr2'><img src='http://greeksubs.ws/templates/gk_moxmovies/favicon.ico'  width='14' height='12'> <a id='not_flag_gr2' href='"+ grurl + "'>"+responseDetails.status+" @ greeksubs.ws</a></span>"; 			
				}
		}
	});	
	
	}

function subs4free_com(moviename){
	var link = document.getElementById('sub_results');
	GM_xmlhttpRequest({
		method: 'GET',
    url: 'http://subs4free.com/search_report.php?selLang=1&search=' + moviename + '&cat=0',
    headers: {
             'User-agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11',
             'Accept': 'application/atom+xml,application/xml,text/xml',
             },
    onload: function (responseDetails) {

     if (responseDetails.status == 200) {
	      var re = new RegExp("<a href=\"download-\\d", "g");
				var rating = re.exec(responseDetails.responseText);
				if (rating != null) {
				var whoManyResults = responseDetails.responseText.match(/<a href=\"download-\d/g);
						
					 if (whoManyResults.length > 0 ) {
 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.subs4u.gr/images/el.gif  width='14' height='12'> <a href='http://subs4free.com/search_report.php?selLang=1&search="+escape(moviename) + "&cat=0'>Found "+whoManyResults.length+" subtitles @ subs4free.com</a></span>"; 			
           }
				}else{
					link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.subs4u.gr/images/el.gif  width='14' height='12'> <a href='http://subs4free.com/search_report.php?selLang=1&search="+escape(moviename) + "&cat=0'>Status "+responseDetails.statusText+" 0 subtitles @ subs4free.com</a></span>"; 			
	      }
					

			
     }else{
	 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.subs4u.gr/images/el.gif  width='14' height='12'> <a id='not_flag_gr2' href='http://www.subs4free.com/portal/infusions/pro_download_panel/search.php?stext="+escape(moviename)+"'>"+responseDetails.status+" @ subs4free.com</a></span>"; 			
				}
		}
	});	
	
	}

function greeksubs_com(moviename){
	var link = document.getElementById('sub_results');
//	http://www.greeksubs.com/subtitles.php?title=123
	  GM_xmlhttpRequest({
    method: "post",
    url: 'http://www.greeksubs.com/subtitles.php',
    headers: { "Content-type" : "application/x-www-form-urlencoded" },
    data:'title='+encodeURIComponent(moviename),
  onload:function(responseDetails) {

			if (responseDetails.status == 200) {
	      var re = new RegExp("get\.php\\?subtitleid", "g");
				var rating = re.exec(responseDetails.responseText);
				if (rating != null) {

				var whoManyResults = responseDetails.responseText.match(/get\.php\?subtitleid/g);
					 if (whoManyResults.length > 0 ) {
 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.greeksubs.com/favicon.ico  width='14' height='12'> <a href='http://www.greeksubs.com/subtitles.php'>Found "+ whoManyResults.length +" subtitles @ greeksubs.com</a></span>"; 			
           }
				}else{
					link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.greeksubs.com/favicon.ico  width='14' height='12'> <a href='http://www.greeksubs.com/subtitles.php'>Status "+responseDetails.statusText+" 0 subtitles @ greeksubs.com</a></span>"; 			
	      }
					

			
     }else{
	 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.greeksubs.com/favicon.ico width='14' height='12'> <a id='not_flag_gr2' href='http://www.greeksubs.com/subtitles.php'>"+responseDetails.status+"  @ greeksubs.com</a></span>"; 			
				}
		}
	});	
	
	}
	
function getsubs4u_gr(moviename){
	var link = document.getElementById('sub_results');

	GM_xmlhttpRequest({
		method: 'GET',
		url: 'http://www.subs4u.gr/search_report.php?selLang=1&search=' + moviename + '&cat=0',
    headers: {
             'User-agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11',
             'Accept': 'application/atom+xml,application/xml,text/xml',
             },
    onload: function (responseDetails) {

			if (responseDetails.status == 200) {
	      var re = new RegExp("downl_redirect\.php", "g");
				var rating = re.exec(responseDetails.responseText);
				if (rating != null) {
				var whoManyResults = responseDetails.responseText.match(/images\/el\.gif/g);
					 if (whoManyResults.length > 1 ) {
 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.subs4u.gr/images/el.gif width='14' height='12'> <a href='http://www.subs4u.gr/search_report.php?selLang=1&search="+escape(moviename)+"&cat=0>Found "+((whoManyResults.length) - 1)+" subtitles @ subs4u.gr</a></span>"; 			
           }
				}else{
					link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.subs4u.gr/images/el.gif width='14' height='12'> <a href='http://www.subs4u.gr/search_report.php?selLang=1&search="+escape(moviename)+"&cat=0>Status "+responseDetails.statusText+" 0 subtitles @ subs4u.gr</a></span>"; 			
	      }
					

			
     }else{
	 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.subs4u.gr/images/el.gif  width='14' height='12'> <a id='not_flag_gr2' href='http://www.subs4u.gr/search_report.php?selLang=1&search="+escape(moviename)+"&cat=0'>"+responseDetails.status+" @ subs4u.gr</a></span>"; 			
				}
		}
	});	
	
	}
		




function getGreekSubtitleProjectResults(moviename){
	var link = document.getElementById('sub_results');
	GM_xmlhttpRequest({
		method: 'GET',
		url: 'http://greeksubtitlesproject.com/search.php?name=' + moviename + '&Submit=Search',
    headers: {
             'User-agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11',
             'Accept': 'application/atom+xml,application/xml,text/xml',
             },
    onload: function (responseDetails) {

			if (responseDetails.status == 200) {
	      var re = new RegExp("<\/a><\/td>", "g");
				var rating = re.exec(responseDetails.responseText);
				if (rating != null) {
				var whoManyResults = responseDetails.responseText.match(/<td>\d{1,}.<\/td>/g);
				
					 if (whoManyResults.length > 0 ) {
 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.subtitles.gr/favicon.ico  width='14' height='12'> <a href='http://greeksubtitlesproject.com/search.php?name="+escape(moviename)+">Found "+whoManyResults.length+" subtitles @ greeksubtitlesproject</a></span>"; 			
           }
				}else{
					link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.subtitles.gr/favicon.ico  width='14' height='12'> <a href='http://greeksubtitlesproject.com/search.php?name="+escape(moviename)+">Status "+responseDetails.statusText+" 0 subtitles @ greeksubtitlesproject</a></span>"; 			
	      }
					

			
     }else{
	 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.subtitles.gr/favicon.ico  width='14' height='12'> <a id='not_flag_gr2' href='http://greeksubtitlesproject.com/search.php?name="+escape(moviename)+"'>"+responseDetails.status+" @ greeksubtitlesproject</a></span>"; 			
				}
		}
	});	
	
	}


function getsubsgr(moviename){
	var link = document.getElementById('sub_results');
	GM_xmlhttpRequest({
		method: 'GET',
		url: 'http://www.subs.gr/portal/infusions/pro_download_panel/search.php?stext=' + moviename,
    headers: {
             'User-agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11',
             'Accept': 'application/atom+xml,application/xml,text/xml',
             },
    onload: function (responseDetails) {

			if (responseDetails.status == 200) {
	      var re = new RegExp("<th colspan=\"2\"><strong>", "g");
				var rating = re.exec(responseDetails.responseText);
				if (rating != null) {
				var whoManyResults = responseDetails.responseText.match(/<td>\d{1,}.<\/td>/g);
				
					 if (whoManyResults.length > 0 ) {
 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.subs.gr/favicon.ico  width='14' height='12'> <a href='http://www.subs.gr/portal/infusions/pro_download_panel/search.php?stext="+escape(moviename)+">Found "+whoManyResults.length+" subtitles @ subs.gr</a></span>"; 			
           }
				}else{
					link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.subs.gr/favicon.ico  width='14' height='12'> <a href='http://www.subs.gr/portal/infusions/pro_download_panel/search.php?stext="+escape(moviename)+">Status "+responseDetails.statusText+" 0 subtitles @ subs.gr</a></span>"; 			
	      }
					

			
     }else{
	 link.innerHTML += 
"<br><span id='flag_gr2'><img src=http://www.subs.gr/favicon.ico  width='14' height='12'> <a id='not_flag_gr2' href='http://www.subs.gr/portal/infusions/pro_download_panel/search.php?stext="+escape(moviename)+"'>"+responseDetails.status+" @ subs.gr</a></span>"; 			
				}
		}
	});	
	
	}
	

function getOpensubsResults(movieid){
	//alert(whatlang);
		if (whatlang == 'greek'){
		var opensubslang = 'ell';
		}
	  else if (whatlang == 'turkish'){
		var opensubslang = 'tur';
		}else if (whatlang == 'english'){
		var opensubslang = 'eng';
		}else if (whatlang == 'arabic'){
		var opensubslang = 'ara';
		}
		
		
		

	
	var link = document.getElementById('sub_results');
	var openlink = 'http://www.opensubtitles.org/en/search/sublanguageid-'+opensubslang+'/imdbid-'+movieid+'/simplexml';
	//var openlink = 'http://www.opensubtitles.com/en/search/sublanguageid-'+opensubslang+'/imdbid-'+movieid;
//GM_log(openlink);
	GM_xmlhttpRequest({
		method: 'GET',
		url: openlink,
    headers: {
             'User-agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; el; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11',
             'Accept': 'application/atom+xml,application/xml,text/xml',
             },
    onload: function (responseDetails) {


			if (responseDetails.status == 200) {
				//itemsfound="(\d{1,})"
				var itemsfoundregex = new RegExp(/itemsfound='(\d{1,})'/);
				var itemsfoundexec = itemsfoundregex.exec(responseDetails.responseText);
				if (itemsfoundexec == null){
link.innerHTML += "<br><span id='flag_gr2'><img src=http://www.opensubtitles.com/favicon.ico width='14' height='12'> <a href='"+openlink.replace(/\/simplexml$/,'')+">Status "+responseDetails.statusText+" 0 subtitles @ opensubtitles.com</a></span>";
					}else{

link.innerHTML += "<br><span id='flag_gr2'><img src=http://www.opensubtitles.com/favicon.ico width='14' height='12'> <a href='"+openlink.replace(/\/simplexml$/,'')+">Found "+itemsfoundexec[1]+" subtitles  @ opensubtitles.com</a></span>";
}

	
	}else{
		link.innerHTML += "<br><span id='flag_gr2'><img src=http://www.opensubtitles.com/favicon.ico width='14' height='12'> <a href='"+openlink+">Error "+responseDetails.statusText+"  @ opensubtitles.com</a></span>";
		}
	}
		});
	}





//GM_addStyle('span#flag_gr2 {font-size:0.4em;margin-left:17px;padding-top:6px} ');
GM_addStyle('span#flag_gr2 {font-size:0.9em;margin-left:2px;} ');
}


}




/*
pages 
http://www.greeksubs.com/ is using "post" OK
http://www.subs4u.gr/search_report.php?search=Dark+Star OK
http://www.greeksubtitlesproject.com/greek_subtitles.php?start=1000 OK

http://www.allsubs.org/search-subtitle stupid
http://greek-subtitles.mysubtitles.org/movie/dark-star_94919.html stupid
http://subscene.com/greek/Iron-Man-Ironman/subtitle-144741.aspx den mporo na psakso
http://divxtitles.com/Dark%20Star/Greek/any/1
http://www.podnapisi.net/ppodnapisi/search?tbsl=1&sK=Dark+Star&sJ=16&sY=&submit=Search skata
http://www.all4divx.com/subtitles/The+Big+Sleep/Greek/any/1 :-)
http://www.all4divx.com/subtitles/National+Treasure+Book+of+Secrets/Greek/any/1  :-)
moviesubtitles.org 
subtitlesbox.com


*/