<!--

// browser
userAgent = navigator.userAgent;
ver = parseInt(navigator.appVersion)
ief = (ver > 3  && navigator.appName != "Netscape" && userAgent.indexOf("MSIE")!=-1 && userAgent.indexOf("Opera")==-1)?1:0
opf = (ver > 3  && navigator.appName != "Netscape" && userAgent.indexOf("MSIE")!=-1 && userAgent.indexOf("Opera")!=-1)?1:0
nsf = (ver > 3  && navigator.appName == "Netscape")?1:0

// select tv
function fun_sel()
{
	var f = document.forma1;
	var val_sel = f.name_sel.options[f.name_sel.selectedIndex].value;
	var text_sel = f.name_sel.options[f.name_sel.selectedIndex].text;
	if(val_sel != "")
	{
		var text_selsm = text_sel.substr(0,4);
		var text_selsmlc = text_selsm.toLowerCase()
		f.phototv.src = "img/tv/"+text_selsmlc+".jpg";
	}
	else
	{
		f.phototv.src = "img/tv/tvno.jpg";
	}
}

// fun button
function fun_but()
{
	var f = document.forma1;
	var val_sel = f.name_sel.options[f.name_sel.selectedIndex].value;
	if(val_sel != "")
	{
		var val_sel_len = val_sel.length;
		var val_sel_len = val_sel_len - 5;
		var val_sel_len = val_sel_len - 6;
		var val_sel = val_sel.substr(0, val_sel_len);
		var val_sel = val_sel.replace('ftp://','mms://');
		f.name_player.url = val_sel;
	}
	else
	{
		alert("airchiet tele arhi");
	}
}

// add favorite
function addfav(i_name, i_file, i_id)
{
	if(ief)
	{
		//var f_url = "http://www.gadmoicere.com?ref=view_"+i_file+"?tid="+i_id; 
		var f_url = "http://www.gadmoicere.com/view_"+i_file+"?tid="+i_id;
		window.external.addFavorite(f_url, i_name);
	}
	else if(opf)
	{
		alert("The function is not supported");
	}
	else if(nsf)
	{
		alert("The function is not supported");
	}
	else
	{
		alert("The function is not supported");
	}
}

// tell a friend
function tellafriend(i_name, i_file, i_id)
{
	var f_url = "http://www.gadmoicere.com/view_"+i_file+"?tid="+i_id;
	alert(f_url+"\n"+i_name);
}
// images
if(document.images)
{
	home = new Image();
	home.src = "img/title/home.jpg";

	service = new Image();
	service.src = "img/title/service.jpg";

	web_catalog = new Image();
	web_catalog.src = "img/title/web_catalog.jpg";

	movies = new Image();
	movies.src = "img/title/movies.jpg";

	programms = new Image();
	programms.src = "img/title/programms.jpg";

	games = new Image();
	games.src = "img/title/games.jpg";

	search = new Image();
	search.src = "img/title/search.jpg";

}

//


function f_title(img_name)
{

	if(document.images)
	{
		document.images["img_title"].src = eval(img_name+".src");
	}
}

// view image

function m_img(path)
{
	wind3 = window.open(path,'wind3','width=200,height=300,top=0,left=0,menubar=no,resizable=0,scrollbars=0,toolbar=0,status=1');
}

// movies search

function pm_search()
{
	
	var f = document.form1;
	var s4 = f.s4.options[f.s4.selectedIndex].value;
	var s5 = f.s5.options[f.s5.selectedIndex].value;
	var s6 = f.s6.options[f.s6.selectedIndex].value;
	var s7 = f.s7.options[f.s7.selectedIndex].value;
	var s8 = f.s8.options[f.s8.selectedIndex].value;
	var s10 = f.s10.options[f.s10.selectedIndex].value;
	var s11 = f.s11.options[f.s11.selectedIndex].value;
	var s12 = f.s12.options[f.s12.selectedIndex].value;
	var s22 = f.s22.options[f.s22.selectedIndex].value;
	//
	var s1 = f.s1.value;
	var s2 = f.s2.value;
	var s3 = f.s3.value;
	var s9 = f.s9.value;
	var s13 = f.s13.value;
	var s14 = f.s14.value;
	var s15 = f.s15.value;
	var s16 = f.s16.value;
	var s17 = f.s17.value;
	var s18 = f.s18.value;
	var s19 = f.s19.value;
	var s20 = f.s20.value;
	var s21 = f.s21.value;
	
	opener.window.location.href = "movies.php?qtype=search&s1="+s1+"&s2="+s2+"&s3="+s3+"&s4="+s4+"&s5="+s5+"&s6="+s6+"&s7="+s7+"&s8="+s8+"&s9="+s9+"&s10="+s10+"&s11="+s11+"&s12="+s12+"&s13="+s13+"&s14="+s14+"&s15="+s15+"&s16="+s16+"&s17="+s17+"&s18="+s18+"&s19="+s19+"&s20="+s20+"&s21="+s21+"&s22="+s22;
}

// games search

function g_search()
{
	
	var f = document.form1;
	var s4 = f.s4.options[f.s4.selectedIndex].value;
	var s8 = f.s8.options[f.s8.selectedIndex].value;
	var s10 = f.s10.options[f.s10.selectedIndex].value;
	var s11 = f.s11.options[f.s11.selectedIndex].value;
	var s12 = f.s12.options[f.s12.selectedIndex].value;
	var s22 = f.s22.options[f.s22.selectedIndex].value;
	//
	var s2 = f.s2.value;
	var s9 = f.s9.value;
	var s19 = f.s19.value;
	var s20 = f.s20.value;
	var s21 = f.s21.value;
	
	opener.window.location.href = "games.php?qtype=search&s2="+s2+"&s4="+s4+"&s8="+s8+"&s9="+s9+"&s10="+s10+"&s11="+s11+"&s12="+s12+"&s19="+s19+"&s20="+s20+"&s21="+s21+"&s22="+s22;
}

// flash search

function f_search()
{
	
	var f = document.form1;
	var s4 = f.s4.options[f.s4.selectedIndex].value;
	var s8 = f.s8.options[f.s8.selectedIndex].value;
	var s22 = f.s22.options[f.s22.selectedIndex].value;
	//
	var s2 = f.s2.value;
	
	opener.window.location.href = "flash.php?qtype=search&s2="+s2+"&s4="+s4+"&s8="+s8+"&s22="+s22;
}

// news search

function n_search()
{
	
	var f = document.form1;
	var s4 = f.s4.options[f.s4.selectedIndex].value;
	var s7 = f.s7.options[f.s7.selectedIndex].value;
	var s8 = f.s8.options[f.s8.selectedIndex].value;
	var s22 = f.s22.options[f.s22.selectedIndex].value;
	//
	var s2 = f.s2.value;
	
	opener.window.location.href = "news.php?qtype=search&s2="+s2+"&s4="+s4+"&s7="+s7+"&s8="+s8+"&s22="+s22;
}

// photo search

function ph_search()
{
	
	var f = document.form1;
	var s4 = f.s4.options[f.s4.selectedIndex].value;
	var s8 = f.s8.options[f.s8.selectedIndex].value;
	var s22 = f.s22.options[f.s22.selectedIndex].value;
	//
	var s2 = f.s2.value;
	
	opener.window.location.href = "photo.php?qtype=search&s2="+s2+"&s4="+s4+"&s8="+s8+"&s22="+s22;
}

// check georgian

function check_geo()
{
	var f = document.form1;
	if(f.check.checked == true)
	{
		f.s2.style.fontFamily = "BPG Glaho Mix,Bauhaus Georgian,Bordeaux Georgian,AcadNusx,AcadNusx Wd,AcadMtavr,Arachveulebrivi Thin,GEO-Gorda,GEO-Grigolia;";
	}
	else
	{
		f.s2.style.fontFamily = "Tahoma,Verdana,Arial";
	}
}

// search programms

function p_search()
{
	
	var f = document.form1;
	var s4 = f.s4.options[f.s4.selectedIndex].value;
	var s8 = f.s8.options[f.s8.selectedIndex].value;
	var s10 = f.s10.options[f.s10.selectedIndex].value;
	var s11 = f.s11.options[f.s11.selectedIndex].value;
	var s12 = f.s12.options[f.s12.selectedIndex].value;
	var s22 = f.s22.options[f.s22.selectedIndex].value;
	//
	var s2 = f.s2.value;
	var s9 = f.s9.value;
	var s19 = f.s19.value;
	var s20 = f.s20.value;
	var s21 = f.s21.value;
	
	opener.window.location.href = "programms.php?qtype=search&s2="+s2+"&s4="+s4+"&s8="+s8+"&s9="+s9+"&s10="+s10+"&s11="+s11+"&s12="+s12+"&s19="+s19+"&s20="+s20+"&s21="+s21+"&s22="+s22;
}

// search web catalog

function wc_search()
{
	
	var f = document.form1;
	var s4 = f.s4.options[f.s4.selectedIndex].value;
	var s8 = f.s8.options[f.s8.selectedIndex].value;
	var s22 = f.s22.options[f.s22.selectedIndex].value;
	//
	var s19 = f.s19.value;
	var s20 = f.s20.value;
	var s21 = f.s21.value;
	
	opener.window.location.href = "web_catalog.php?qtype=search&s4="+s4+"&s8="+s8+"&s19="+s19+"&s20="+s20+"&s21="+s21+"&s22="+s22;
}

// movies popup
function popup_m1(url)
{
	window.open(url,'','width=600,height=410,top=0,left=0,resizable=0,menubar=0,toolbar=0,status=1');
}
// games popup
function popup_g1(url)
{
	window.open(url,'','width=600,height=300,top=0,left=0,resizable=0,menubar=0,toolbar=0,status=1');
}
// flash popup
function popup_f1(url)
{
	window.open(url,'','width=400,height=180,top=0,left=0,resizable=0,menubar=0,toolbar=0,status=1');
}
// photo popup
function popup_ph1(url)
{
	window.open(url,'','width=400,height=180,top=0,left=0,resizable=0,menubar=0,toolbar=0,status=1');
}
// news popup
function popup_n1(url)
{
	window.open(url,'','width=400,height=200,top=0,left=0,resizable=0,menubar=0,toolbar=0,status=1');
}
// web catalog popup
function popup_wc1(url)
{
	window.open(url,'','width=600,height=200,top=0,left=0,resizable=0,menubar=0,toolbar=0,status=1');
}
// subscribe
function subscribe_tell()
{
	wind = window.open('php/subscribe.php','wind','width=380,height=420,left=0,top=0,direction=0,resizable=0,menubar=0,status=1,scrollbars=0,toolbar=0');
	wind.focus();
}
// subscribe
function tellaf()
{
	wind = window.open('php/tell.php','wind','width=380,height=420,left=0,top=0,direction=0,resizable=0,menubar=0,status=1,scrollbars=0,toolbar=0');
	wind.focus();
}
// open_flash
function open_flash(url, f_w, f_h)
{
	f_w = new Number(f_w);
	f_h = new Number(f_h);

	var f_w2 = f_w + 150;
	var f_h2 = f_h + 150;
	window.open('view_flash.php?s1='+url+'&s2='+f_w+'&s3='+f_h,'','width='+f_w2+',height='+f_h2+',top=0,left=0,resizable=1,menubar=0,toolbar=0,status=1,scrollbars=0');
}
// open_photo
function open_photo(tid)
{
	var f_w2 = 780;
	var f_h2 = 780;
	window.open('view_photo.php?tid='+tid,'','width='+f_w2+',height='+f_h2+',top=0,left=0,resizable=1,menubar=0,toolbar=0,status=1,scrollbars=1');
}
// open_news
function open_news(nid)
{
	var f_w2 = 600;
	var f_h2 = 680;
	window.open('view_flash.php?s1='+nid,'','width='+f_w2+',height='+f_h2+',top=0,left=0,resizable=1,menubar=0,toolbar=0,status=1,scrollbars=0');
}
// check
function subscribe(event)
{
	var f = document.form1;
	var error = "";
	var your_email_reg = /([a-z0-9]){1,30}([0-9]|\.|-|_)?([a-z0-9]){1,30}@([a-z0-9]{1,25}(-|\.))?([a-z0-9]{1,25}(-|\.))?[a-z0-9]{2,25}\.(([a-z]){2,4}|([a-z]){2,3}(\.([a-z]){2})?)$/;
	//
	f.event.value = event;
	if(!your_email_reg.test(f.your_email.value))
	{
		error = error + "arascoria el. fosta \n";
	}
	//
	if(error)
	{
		alert(error);
	}
	else
	{
		f.submit();
	}
}
// tell a friend
function tell_a_friend()
{
	var f = document.form1;
	var error = "";
	var your_email_reg = /([a-z0-9]){1,30}([0-9]|\.|-|_)?([a-z0-9]){1,30}@([a-z0-9]{1,25}(-|\.))?([a-z0-9]{1,25}(-|\.))?[a-z0-9]{2,25}\.(([a-z]){2,4}|([a-z]){2,3}(\.([a-z]){2})?)$/;
	var your_name_reg = /^([a-zA-Z]){3,10}$/;
	//
	if(!your_email_reg.test(f.your_email.value))
	{
		error = error + "arascoria el. fosta \n";
	}
	//
	if(!your_name_reg.test(f.your_name.value))
	{
		error = error + "arascoria saheli \n";
	}
	//
	if(error)
	{
		alert(error);
	}
	else
	{
		f.submit();
	}
}
// tell a friend - link -
function tell_fav(var_page, var_id, var_type, var_text)
{
	wind = window.open('php/tell_fav.php?s1='+var_page+'&s2='+var_id+'&s3='+var_type+'&s4='+var_text,'wind1','width=380,height=420,left=0,top=0,direction=0,resizable=0,menubar=0,status=1,scrollbars=0,toolbar=0');
	wind.focus();
}
// about link -
function about_links(var_type)
{
	wind = window.open('php/tell_site.php?s3='+var_type,'wind','width=380,height=420,left=0,top=0,direction=0,resizable=0,menubar=0,status=1,scrollbars=0,toolbar=0');
	wind.focus();
}

// tell us
function tell_us()
{
	var f = document.form1;
	var error = "";
	var your_url_reg = /^(http:\/\/|https:\/\/|ftp\.|ftp:\/\/|ed2k:\/\/)([a-zA-Z0-9]|#|&|-|_|\/|\.|\(|\)|\[|\]|\||\{|\}|\?|%){5,200}$/;
	var your_name_reg = /^([a-zA-Z]){3,10}$/;
	//
	if(!your_url_reg.test(f.your_url.value))
	{
		error = error + "arascoria internet misamarti \n";
	}
	//
	if(!your_name_reg.test(f.your_name.value))
	{
		error = error + "arascoria saheli \n";
	}
	//
	if(error)
	{
		alert(error);
	}
	else
	{
		f.submit();
	}
}

// block

function toggle(obj)
{ 
	obj.style.display = (obj.style.display == "block") ? obj.style.display = "none" : obj.style.display = "block"; 
} 

// show

function show(tid)
{
	var obj = document.getElementById(tid);
	obj.style.display = (obj.style.display == "block") ? obj.style.display = "none" : obj.style.display = "block";
}
// help link -
function help_link()
{
	wind4 = window.open('help.html','wind4','width=290,height=300,left=0,top=0,direction=0,resizable=0,menubar=0,status=1,scrollbars=0,toolbar=0');
	wind4.focus();
}

// search normal

// movies search normal

function nm_search()
{
	
	var f = document.form2;
	var s4 = f.s4.options[f.s4.selectedIndex].value;
	var s5 = f.s5.options[f.s5.selectedIndex].value;
	var s6 = f.s6.options[f.s6.selectedIndex].value;
	var s7 = f.s4.options[f.s7.selectedIndex].value;
	var s8 = f.s8.options[f.s8.selectedIndex].value;
	var s10 = f.s10.options[f.s10.selectedIndex].value;
	var s11 = f.s11.options[f.s11.selectedIndex].value;
	var s12 = f.s12.options[f.s12.selectedIndex].value;
	var s22 = f.s22.options[f.s22.selectedIndex].value;
	//
	var s1 = f.s1.value;
	var s2 = f.s2.value;
	var s3 = f.s3.value;
	var s9 = f.s9.value;
	var s13 = f.s13.value;
	var s14 = f.s14.value;
	var s15 = f.s15.value;
	var s16 = f.s16.value;
	var s17 = f.s17.value;
	var s18 = f.s18.value;
	var s19 = f.s19.value;
	var s20 = f.s20.value;
	var s21 = f.s21.value;
	
	window.location.href = "movies.php?qtype=search&s1="+s1+"&s2="+s2+"&s3="+s3+"&s4="+s4+"&s5="+s5+"&s6="+s6+"&s7="+s7+"&s8="+s8+"&s9="+s9+"&s10="+s10+"&s11="+s11+"&s12="+s12+"&s13="+s13+"&s14="+s14+"&s15="+s15+"&s16="+s16+"&s17="+s17+"&s18="+s18+"&s19="+s19+"&s20="+s20+"&s21="+s21+"&s22="+s22;
}

// games search

function ng_search()
{
	
	var f = document.form4;
	var s4 = f.s4.options[f.s4.selectedIndex].value;
	var s8 = f.s8.options[f.s8.selectedIndex].value;
	var s10 = f.s10.options[f.s10.selectedIndex].value;
	var s11 = f.s11.options[f.s11.selectedIndex].value;
	var s12 = f.s12.options[f.s12.selectedIndex].value;
	var s22 = f.s22.options[f.s22.selectedIndex].value;
	//
	var s2 = f.s2.value;
	var s9 = f.s9.value;
	var s19 = f.s19.value;
	var s20 = f.s20.value;
	var s21 = f.s21.value;
	
	window.location.href = "games.php?qtype=search&s2="+s2+"&s4="+s4+"&s8="+s8+"&s9="+s9+"&s10="+s10+"&s11="+s11+"&s12="+s12+"&s19="+s19+"&s20="+s20+"&s21="+s21+"&s22="+s22;
}

// search programms

function np_search()
{
	
	var f = document.form3;
	var s4 = f.s4.options[f.s4.selectedIndex].value;
	var s8 = f.s8.options[f.s8.selectedIndex].value;
	var s10 = f.s10.options[f.s10.selectedIndex].value;
	var s11 = f.s11.options[f.s11.selectedIndex].value;
	var s12 = f.s12.options[f.s12.selectedIndex].value;
	var s22 = f.s22.options[f.s22.selectedIndex].value;
	//
	var s2 = f.s2.value;
	var s9 = f.s9.value;
	var s19 = f.s19.value;
	var s20 = f.s20.value;
	var s21 = f.s21.value;
	
	window.location.href = "programms.php?qtype=search&s2="+s2+"&s4="+s4+"&s8="+s8+"&s9="+s9+"&s10="+s10+"&s11="+s11+"&s12="+s12+"&s19="+s19+"&s20="+s20+"&s21="+s21+"&s22="+s22;
}

// search web catalog

function nwc_search()
{
	
	var f = document.form1;
	var s4 = f.s4.options[f.s4.selectedIndex].value;
	var s8 = f.s8.options[f.s8.selectedIndex].value;
	var s22 = f.s22.options[f.s22.selectedIndex].value;
	//
	var s19 = f.s19.value;
	var s20 = f.s20.value;
	var s21 = f.s21.value;
	
	window.location.href = "web_catalog.php?qtype=search&s4="+s4+"&s8="+s8+"&s19="+s19+"&s20="+s20+"&s21="+s21+"&s22="+s22;
}

// open video

function open_video(tid, cur_id)
{
	var f_w2 = 480;
	var f_h2 = 495;
	window.open('view_video.php?tid='+tid+'&cur_id='+cur_id,'','width='+f_w2+',height='+f_h2+',top=0,left=0,resizable=1,menubar=0,toolbar=0,status=1,scrollbars=1');
}

// open gom video

function open_gom_video(tid, cur_id)
{
	var f_w2 = 480;
	var f_h2 = 495;
	window.open('view_gom_video.php?tid='+tid+'&cur_id='+cur_id,'','width='+f_w2+',height='+f_h2+',top=0,left=0,resizable=1,menubar=0,toolbar=0,status=1,scrollbars=1');
}

// -->
