﻿function initArray() {
try
{
if(Math.floor(Math.random()*10)>5)
baseidx=10;
else
baseidx=0
}
catch(e)
{}
this.length = initArray.arguments.length;
for (var i = 0; i < this.length; i++) {
this[i] = initArray.arguments[i];
   }
}
// JScript File

function OpenCreditUser()
{
window.location="http://www.Amouzesh.info/Login/UserLogin.aspx?InputType=1"
}
function OpenFreeUser()
{
window.location="http://www.Amouzesh.info/Login/FreeLogin.aspx?InputType=2"
}
function OpenTeacher()
{
window.location="http://www.Amouzesh.info/Login/TeacherLogin.aspx?InputType=3"
}
function OpenView()
{
OpenUrl("http://www.Amouzesh.info/withMe.htm");
}
function Selected(id) 
{ 
try
{
   var element = document.getElementById(id); 
    element.style.background = '#A27683'; 
    element.style.color = '#ffff00'; 
    }
    catch(e)
    {alert(e);}
}
function UnSelected(id) 
{ 
try
{
var    element = document.getElementById(id); 
    element.style.background = '#fcf1fc'; 
    element.style.color = '#0000ff'; 
        }
    catch(e)
    {alert(e);}
}
function ChoseCity()
{
var element = document.getElementById('cmbcity').value;
//alert(element);
display(element,'Pan');
}
function display(sText,items)
{
 try
 {
   var DivItems = document.getElementById(items);
   DivItems.innerHTML =  sText  ;
   //window.scrollTo(0,0);
 }
 catch(e)
 {
 //alert(e);
 }
}
function GetData(url){top.frames["hiddenFrame"].location=url}
function startpage()
{
try
{
timer1=setTimeout('DrawText1()','1000');
timer2=setTimeout('ShowFlash()','3000');
ctimer=setTimeout('GetUserCount()','500');
//ctimer=setTimeout('GetUserCount()','100000');
}
catch(e)
{}
}
var colorindex=0;
var timer1=0;
var timer2=0;
function DrawText1()
{
try
{
display('<span style="color:' + Schema[colorindex] + '">کاربر گرامي به مدرسه مجازي فخردانش خوش آمديد.</span>','Text1');
clearTimeout(timer1);
timer1=setTimeout('DrawText1()','200');
colorindex++;
colorindex=colorindex%16;
}
catch(e)
{}
}
function ShowFlash()
{
try
{
clearTimeout(timer2);
var shtml='<object height="180" width="780" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" xcodebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">';
shtml+='<param name="Movie" value="swf/Header.swf"    /><param name="Quality" value="high"   /><param name="wmode" value="transparent"   /><param name="scale" value="Exactfit"   /><embed src="swf/Header.swf" width="780" height="180" quality="high" wmode="transparent" scale="exactfit" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"   ></embed>';
shtml +='</object>';
display(shtml,'FlasPlace');
}
catch(e)
{}
}
var Schema = new initArray(
"rgb(255,0,0)",
"rgb(255,85,0)",
"rgb(255,170,0)",
"rgb(255,255,0)",
"rgb(170,255,0)",
"rgb(85,255,0)",
"rgb(0,255,0)",
"rgb(0,255,85)",
"rgb(0,255,170)",
"rgb(0,255,255)",
"rgb(0,170,255)",
"rgb(0,85,255)",
"rgb(0,0,255)",
"rgb(85,0,255)",
"rgb(170,0,255)",
"rgb(255,0,255)"
)

        var ctimer;
function GetUserCount()
{
    try
    {
        clearTimeout(ctimer);
        getData('usercount.aspx');
        ctimer=setTimeout('GetUserCount()',100000);
    }
    catch(e)
    {
    alert('sd');
    }
}

function getData(url)
{
    try
    {
        top.frames["hiddenFrame"].location=url;
    }
    catch(e)
    {
        alert('دریافت اطلاعات دچار مشکل شد.دوباره اقدام نمایید' + '\n' +  e);
    }
}

function display(sText,items)
{
 try
 {
   var DivItems = document.getElementById(items);
   DivItems.innerHTML =  sText  ;
 }
 catch(e)
 {
 alert(e);
 }
}
function OpenUrl(url)
{
    try
    {
        var opts = '';
        var sW='1024';
        var sH='768';
        try
        {
            sW=screen.Width ;
            sH=screen.Height ;
        }
        catch(e){}
        opts = 'width=' + sW + 'px,height=' + sH + 'px,resizable=yes,scrollbars=yes,directories=no,status=yes,location=no,toolbar=no';
        window.open(url,"",opts);
    }
    catch(e){}
}