function ctrl_platf(param)
{
    if (_get_os() == "MOBILE"){
    window.location.href = param;}
}

function _get_os()
{
    if (navigator.platform.indexOf("WinCE") >= 0) return "MOBILE";
    else if (navigator.platform.indexOf("MacPPC") >= 0) return "MOBILE";
    else if (screen.width <= 480) return "MOBILE";
    return "UNKNOWN";
}

function SrlWnd() {
	
}

function ClkScrn() {
	s=screen;
	kfW=0.8; kfH=0.8; kfL=0.8; kfT=0.7;
	if (s.width>1000) {kfW=1; kfH=1; kfL=1; kfT=1;}
}
function WdthZg1() {
	s=screen;
	if (s.width>1000) {
	document.write("<div class='pr2' style='width: 756; height: 80'>")
	}
	else {
	document.write("<div class='pr2' style='width: 643; height: 80'>")
	}
}

function WdthZg2() {
document.write("</div>")
}

function OutPic(param) {
 pth3="photo/";
 ret=ClkScrn();
 wdt=340; hgh=440;
 param2=pth3+"CD_"+param+".jpg";
 if(param == 9000){wdt=340; hgh=445;txt="Я не всегда такой 'жук' ..."}
 if(param == 9001){wdt=320; hgh=405;txt="Чтобы еще такое сюда добавить ..."}
 if(param == 9002){wdt=310; hgh=445;txt="Рад видеть всех вместе ..."}
wdt=kfW*wdt; hgh=kfH*hgh; lft=kfL*620; tpt=kfT*150
 win110 = window.open('','w1','width='+wdt+', height='+hgh+', left='+lft+', top='+tpt);
 win110.document.open("text/html");
 win110.document.writeln("<html>");
 win110.document.writeln("<head>");
 win110.document.writeln("<title>Photo</title>");
 win110.document.writeln("</head>");
 win110.document.writeln("<body bgcolor='#808080'>");
 win110.document.writeln("<center><form>");
 win110.document.writeln("<img border='1' src='"+param2+"'width='"+0.9*wdt+"', height='"+0.9*hgh+"'>");
 win110.document.writeln("<font face='Arial' color='#ffff99' size='1'>");
 win110.document.writeln("<br>"+txt);
 win110.document.writeln("</font>");
 win110.document.writeln("</form></center>");
 win110.document.writeln("</body>");
 win110.document.writeln("</html>");
 win110.document.close();
}
function ClsPic() {
 win110.window.close();
}
function MakeArray(n) {
	this.length = n
	return this
}
monthNames = new MakeArray(12)
monthNames[1] = "января"
monthNames[2] = "февраля"
monthNames[3] = "марта"
monthNames[4] = "апреля"
monthNames[5] = "мая"
monthNames[6] = "июня"
monthNames[7] = "июля"
monthNames[8] = "августа"
monthNames[9] = "сентября"
monthNames[10] = "октября"
monthNames[11] = "ноября"
monthNames[12] = "декабря"
dayNames = new MakeArray(7)
dayNames[1] = "воскресенье"
dayNames[2] = "понедельник"
dayNames[3] = "вторник"
dayNames[4] = "среда"
dayNames[5] = "четверг"
dayNames[6] = "пятница"
dayNames[7] = "суббота"

function customDateString() {
	currentDate = new Date()
	var theDay = dayNames[currentDate.getDay() + 1]
	var theMonth = monthNames[currentDate.getMonth() + 1]
	msie4 = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ));
	if (msie4) {
	    var theYear = currentDate.getYear()
	}
	else {
	     var theYear = currentDate.getYear() +1900
	}
	return  "Сегодня - " + currentDate.getDate() + " " + theMonth + " " + theYear + " (" + theDay + ")"
}
function showFilled(Value) {
  return (Value > 9) ? "" + Value : "0" + Value;
}
function StartClock24() {
  TheTime = new Date;
  document.clock.showTime.value = showFilled(TheTime.getHours()) + ":" + showFilled(TheTime.getMinutes()) + ":" + showFilled(TheTime.getSeconds());
  setTimeout("StartClock24()",1000)
}

function imglink(kk){
  ClkScrn();
  ss=screen;
  if (ss.width>1650){if (kk==0) jk=17
   if (kk==1) jk=19
   if (kk==2) jk=23
   if (kk==3) jk=17
   if (kk==4) jk=25
   if (kk==5) jk=33}
  else {
   if (ss.width>1000){if (kk==0) jk=7
   if (kk==1) jk=10
   if (kk==2) jk=12
   if (kk==3) jk=8
   if (kk==4) jk=15
   if (kk==5) jk=15}
  else {if (kk==0) jk=8
   if (kk==1) jk=15
   if (kk==2) jk=12
   if (kk==3) jk=12
   if (kk==4) jk=22
   if (kk==5) jk=17}
   }
  for (i=1;i<jk;i++)
  random_imglink(); 
}

function random_imglink(){
var m = new Array(0);
y=0
var y=0;
 while (y==0) {
    y=Math.round(Math.random()*8100);
    for (ii=0;ii<1;ii++){
              if (y==m[ii]) y=0; 
                      };
              };
    if (y<2000) {
 document.write('<a href="PPS1/sd_'+y+'.htm"><img border="1" style="border-style: solid; border-color: #000000" src="converts1/CD_'+y+'.JPG" border="0" height='+kfH*77+' width='+kfW*77+'></a> ')};
    if ((y>=2000)&&(y<=2999)) {
 document.write('<a href="PPS2/sd_'+y+'.htm"><img border="1" style="border-style: solid; border-color: #000000"  src="converts2/CD_'+y+'.JPG" border="0" height='+kfH*77+' width='+kfW*77+'></a> ')};
    if ((y>=3000)&&(y<=3999)) {
 document.write('<a href="PPS3/sd_'+y+'.htm"><img border="1" style="border-style: solid; border-color: #000000"  src="converts3/CD_'+y+'.JPG" border="0" height='+kfH*77+' width='+kfW*77+'></a> ')};
    if ((y>=4000)&&(y<=4999)) {
 document.write('<a href="PPS4/sd_'+y+'.htm"><img border="1" style="border-style: solid; border-color: #000000"  src="converts4/CD_'+y+'.JPG" border="0" height='+kfH*77+' width='+kfW*77+'></a> ')};
    if ((y>=5000)&&(y<=5999)) {
 document.write('<a href="PPS5/sd_'+y+'.htm"><img border="1" style="border-style: solid; border-color: #000000"  src="converts5/CD_'+y+'.JPG" border="0" height='+kfH*77+' width='+kfW*77+'></a> ')};
    if ((y>=6000)&&(y<=6999)) {
 document.write('<a href="PPS6/sd_'+y+'.htm"><img border="1" style="border-style: solid; border-color: #000000"  src="converts6/CD_'+y+'.JPG" border="0" height='+kfH*77+' width='+kfW*77+'></a> ')};
    if ((y>=7000)&&(y<=7999)) {
 document.write('<a href="PPS7/sd_'+y+'.htm"><img border="1" style="border-style: solid; border-color: #000000"  src="converts7/CD_'+y+'.JPG" border="0" height='+kfH*77+' width='+kfW*77+'></a> ')};
    if (y>=8000) {
 document.write('<a href="PPS8/sd_'+y+'.htm"><img border="1" style="border-style: solid; border-color: #000000"  src="converts8/CD_'+y+'.JPG" border="0" height='+kfH*77+' width='+kfW*77+'></a> ')};
}

