/**
 * SWFObject v1.4.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
 *   legal reasons.
 */
 if(document.all && !document.getElementById) { /*ie4*/
document.getElementById= function(id) {
return(document.all(id));
}
document.getElementsByTagName= function(id) {
return(document.all.tags(id));
}
}
if(document.layers) { /*ns4*/
document.getElementById= function(id) {
return(document.layers[id]);
}
}
if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){alert("NO!");return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){_16.push(key+"="+_18[key]);}
return _16;},getSWFHTML:function(){var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");}
_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\"";
_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";
}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\">";
_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();return true;
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){
var _23=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}
}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}
catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return _23;};
deconcept.PlayerVersion=function(_27){
this.major=_27[0]!=null?parseInt(_27[0]):0;
this.minor=_27[1]!=null?parseInt(_27[1]):0;
this.rev=_27[2]!=null?parseInt(_27[2]):0;
};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){
return false;
}return true;};
deconcept.util={getRequestParameter:function(_29){
var q=document.location.search||document.location.hash;
if(q){var _2b=q.substring(1).split("&");
for(var i=0;i<_2b.length;i++){
if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){
return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return;}
var _2d=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2d.length;i++){_2d[i].style.display="none";for(var x in _2d[i]){
if(typeof _2d[i][x]=="function"){_2d[i][x]=function(){};}}}};
deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};
__flash_savedUnloadHandler=function(){};
if(typeof window.onunload=="function"){
var _30=window.onunload;
window.onunload=function(){
deconcept.SWFObjectUtil.cleanupSWFs();_30();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}};
if(typeof window.onbeforeunload=="function"){
var oldBeforeUnload=window.onbeforeunload;
window.onbeforeunload=function(){
deconcept.SWFObjectUtil.prepUnload();
oldBeforeUnload();};
}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}
if(Array.prototype.push==null){
Array.prototype.push=function(_31){
this[this.length]=_31;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;

var t_id = setInterval(animate,20);
var posz=0;
var dirz=2;
var lenz=0;
function animate()
{
	var elemz = document.getElementById('progress');
	if(elemz != null) {
		if (posz==0) lenz += dirz;
		if (lenz>32 || posz>79) posz += dirz;
		if (posz>79) lenz -= dirz;
		if (posz>79 && lenz==0) posz=0;
		elemz.style.left = posz-50+'px';
		elemz.style.width = lenz+'px';
	}
}
function remove_loading() {
	this.clearInterval(t_id);
	var targelem = document.getElementById('loader_container');
	targelem.style.display='none';
	targelem.style.visibility='hidden';
}
function openwin(url,tend,col,article,size,descr,aurl,aurl1,col1,col2,col3,col4,col5,sid,prev,next,long,lycra,scian,noyon) {
	var width = "600"; // popup width
	if (long>400) var height = "785"; else var height = "580"; // popup height
	var left = (screen.width - width) / 2 ;
	var top = (screen.height - height) / 2;
	var windowproperties = "fullscreen=0, scrollbars=0, width=600, height=550, left=" + left +", top=" + top ;
    var newwin;
    newwin=window.open('', 'aaa', windowproperties);
    newwin.document.clear();
    newwin.focus();
//    alert(url+" "+tend+" "+col+" "+article+" "+size+" "+descr+" "+aurl+" "+aurl1+" "+col1+" "+col2+" "+col3+" "+sid+" "+prev+" "+next);
    newwin.document.writeln('<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"><title>' + tend + " " + col + '<\/title><link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\"><\/head><body style=\"background-image:url(_img/pop_bg.jpg)\">');
    newwin.document.writeln('<div class=\"ppwrap\">');
    newwin.document.writeln('<div class=\"ppleft\">');
    newwin.document.writeln('<div class=\"heading3\">' + col);
    if (aurl) newwin.document.writeln('<a class=\"coll\" href=\"javascript:opener.window.location=\'' + aurl + '\';self.close();\"><img src=\"_img/b_edit.png\" title=\"labot elementu\" border=0></a>');
    if (aurl) newwin.document.writeln('<a class=\"coll\" href=\"javascript:opener.window.location=\'' + aurl1 + '\';self.close();\" onclick=\"if (!confirm(\"Tiešām vēlaties dzēst ?\")) return false;\"><img src=\"_img/b_drop.png\" title=\"dzēst elementu\" border=0></a>');
    newwin.document.writeln('</div>');
    newwin.document.writeln('<div class=\"ppcoll\">');
    if(tend=="") newwin.document.writeln('&nbsp');
    newwin.document.writeln( tend + '</div>');
    newwin.document.writeln('<a href=\"javascript:self.close();\"><img style=\"margin:15px 0 0 5px;border:none;\" src=' + url + ' title=\"' + tend + "/" + col + '\" ></a>');
    newwin.document.writeln('<\/div>');
    newwin.document.writeln('<div class=\"ppright\">');
    if (lycra==1) newwin.document.writeln('<img style=\"margin-top:15px;\" src=\"_img/lycra.gif\" >');
    if (scian==1) newwin.document.writeln('<img style=\"margin-top:15px;\" src=\"_img/scian.gif\" >');
    if (noyon==1) newwin.document.writeln('<img style=\"margin-top:15px;\" src=\"_img/noyon.gif\" >');
    newwin.document.writeln('<div style=\"margin:47px 0 15px 0;\"><b>' + article + '</b><br>' + size + '<br>' + descr + '<\/div>');
    newwin.document.writeln('<div style=\"height:90px;position:absolute;top:220px;\">');

    var cookiename = "language";
    if (document.cookie.length>0) {
        cookieStart = document.cookie.indexOf(cookiename + "=");
        if (cookieStart!=-1) {
          cookieStart += cookiename.length+1; 
          cookieEnd=document.cookie.indexOf(";",cookieStart);
          if (cookieEnd==-1) {
            cookieEnd=document.cookie.length;
          }
          cookietext = document.cookie.substring(cookieStart,cookieEnd);
        } 
    }

    var colorsLV = new Array();
        colorsLV['#FFFFFF']='001 Balts';
        colorsLV['#FFFDED']='003 Šampanietis';
        colorsLV['#F7F4E8']='004 Pienbalts';
        colorsLV['#B96E98']='026 Flamingo';
        colorsLV['#CCB098']='030 Kafija ar pienu';
        colorsLV['#00234B']='058 Tumši zils';
        colorsLV['#C51530']='101 Tumši sarkans';
        colorsLV['#503528']='111 Šokolāde';
        colorsLV['#476088']='141 Vakara krēsla';
        colorsLV['#665c60']='169 Grafīts';
        colorsLV['#000000']='170 Melns';
        colorsLV['#B93339']='579 Granātu sarkans';
        colorsLV['#EFE3CC']='628 Pergaments';
        colorsLV['#7C6766']='738 Pipargraudiņš';
    var colorsRU = new Array();
        colorsRU['#FFFFFF']='001 Белый';
        colorsRU['#FFFDED']='003 Цвет шампанского';
        colorsRU['#F7F4E8']='004 Натуральный белый';
        colorsRU['#B96E98']='026 Фламинго';
        colorsRU['#CCB098']='030 Кофе с молоком';
        colorsRU['#00234B']='058 Темный синий';
        colorsRU['#C51530']='101 Темно-красный';
        colorsRU['#503528']='111 Шоколад';
        colorsRU['#476088']='141 Вечерние сумерки';
        colorsRU['#665c60']='169 Графит';
        colorsRU['#000000']='170 Черный';
        colorsRU['#B93339']='579 Гранатовый красный';
        colorsRU['#EFE3CC']='628 Пергамент';
        colorsRU['#7C6766']='738 Молотый перец';
    var colorsEN = new Array();
        colorsEN['#FFFFFF']='001 White';
        colorsEN['#FFFDED']='003 Champagne';
        colorsEN['#F7F4E8']='004 Natural white';
        colorsEN['#B96E98']='026 Flamingo';
        colorsEN['#CCB098']='030 Caffe latte';
        colorsEN['#00234B']='058 Dark Navy';
        colorsEN['#C51530']='101 Dark red';
        colorsEN['#503528']='111 Chocolate';
        colorsEN['#476088']='141 Purple dusk';
        colorsEN['#665c60']='169 Graphite';
        colorsEN['#000000']='170 Black';
        colorsEN['#B93339']='579 Garnet red';
        colorsEN['#EFE3CC']='628 Parchment';
        colorsEN['#7C6766']='738 Peppercorn';

    if (cookietext=='LV') colors=colorsLV;
        else if (cookietext=='RU') colors=colorsRU;
            else if (cookietext=='EN') colors=colorsEN;
                else colors=colorsLV;
        
    Array.prototype.has=function(key){
        if(key in colors) return colors[key];
        return false;
    }

    
    if (col1) newwin.document.writeln('<div style=\"position:relative;margin-top:5px;background-color:' + col1 + ';border:1px solid #646464;width:22px;height:22px;\"><\/div>'+colors.has(col1));
    if (col2) newwin.document.writeln('<div style=\"position:relative;margin-top:5px;background-color:' + col2 + ';border:1px solid #646464;width:22px;height:22px;\"><\/div>'+colors.has(col2));
    if (col3) newwin.document.writeln('<div style=\"position:relative;margin-top:5px;background-color:' + col3 + ';border:1px solid #646464;width:22px;height:22px;\"><\/div>'+colors.has(col3));
    if (col4) newwin.document.writeln('<div style=\"position:relative;margin-top:5px;background-color:' + col4 + ';border:1px solid #646464;width:22px;height:22px;\"><\/div>'+colors.has(col4));
    if (col5) newwin.document.writeln('<div style=\"position:relative;margin-top:5px;background-color:' + col5 + ';border:1px solid #646464;width:22px;height:22px;\"><\/div>'+colorsLV.has(col5));
    newwin.document.writeln('<\/div>');
    if (long>400) newwin.document.writeln('<div style=\"height:700px;position:absolute;top:548px;\">'); else newwin.document.writeln('<div style=\"height:80px;position:absolute;top:395px;\">');
    newwin.document.writeln('<div style=\"margin-top:10px;\">');
    if (prev != 0) newwin.document.writeln('<a class=\"pphref\" href=\"javascript:opener.window.location=\'' + sid + '&id=' + prev + '&pp=yes\';self.document.clear();\" onmouseover=\"window.status=\'\'; return true;\"><img src=\"_img/arr_l.gif\" > previous</a>');
    if (prev != 0 && next != 0)newwin.document.writeln(' | ');
    if (next != 0) newwin.document.writeln('<a class=\"pphref\" href=\"javascript:opener.window.location=\'' + sid + '&id=' + next + '&pp=yes\';self.document.clear();\" onmouseover=\"window.status=\'\'; return true;\"> next <img  src=\"_img/arr_r.gif\" ></a>');
    newwin.document.writeln('<\/div>');
    newwin.document.writeln('<img style=\"margin-top:15px;\" src=\"_img/pop_logo.jpg\" ><br>');
    newwin.document.writeln('<\/div>');
    newwin.document.writeln('<\/div>');
    newwin.document.writeln('<\/div>');
    newwin.document.writeln('<\/body><\/html>');
    newwin.document.close();
    newwin.resizeTo(width, height);
    newwin.moveTo(left, top);
    newwin.focus();
}

var newwin = "";
function logs(Pix)
{
    if (newwin != ""){newwin.close()}
    var newpagehead = "<html><head><title>ROSME</title>";
    newpagehead = newpagehead + "<script language='JavaScript'>function fitpic() { var NS = (navigator.appName=='Netscape')?true:false;  iWidth = (NS)?window.innerWidth:document.body.clientWidth; iHeight = (NS)?window.innerHeight:document.body.clientHeight; iWidth = document.images[0].width - iWidth; iHeight = document.images[0].height - iHeight; window.resizeBy(iWidth, iHeight); var left = (screen.width - iWidth - 50) / 2 ;	var top = (screen.height - iHeight- 50) / 2; window.moveTo(left,top);  self.focus(); }</script>";
    newpagehead = newpagehead + "</head><body bgcolor=black leftmargin=0 topmargin=0 marginwidth=0 marginheight=0>";
    var newpagesrc = "<a href=# onclick=javascript:self.close()><img src=" + Pix + " title='Click to Close' border=0 onload='fitpic()'/></a>";
    var newpagetail = "</body></html>";
    var attrs = "fullscreen=0, scrollbars=0, width=1, height=1";
    newwin = window.open('','window',attrs);
    newwin.document.clear();
    newwin.focus();
    newwin.document.writeln(newpagehead);
    newwin.document.writeln(newpagesrc);
    newwin.document.writeln(newpagetail);
    newwin.document.close();
    newwin.focus();
}

function entsub(event,ds) {
  if (event && event.which == 13)
    window.location.href='?dosearch=' + ds;
  else
    if (window.event && window.event.keyCode == 13)
        window.location.href='?dosearch=' + ds;
    else
        return true;
}
