var secs
var timerID = null
var timerRunning = false
var delay = 100
var size;
for(i=1;i<=10;i++)
if(document.getElementById("medframe"+i)==null)
{med_frame_id=i;
break;}
/*if(med_content=="med010" || med_content=="med022")
	med_content=med_content;
else
	med_content="med010";*/
if(med_size=="250x250" || med_size=="300x250" || med_size=="160x600" || med_size=="336x280")
{		
	border_color=border_color.replace("#","");
	link_color=link_color.replace("#","");
	text_color=text_color.replace("#","");
}
else
{
	med_size="250x250";
}
size=med_size.split("x");
my_frame_id="medframe"+med_frame_id;
mymedsrc="http://www.medindia.com/free-downloads/medindia-widgets/getwidgetcontent.asp?size="+med_size+"&content="+med_content+"&content1="+med_content1+"&lcolor="+link_color+"&bcolor="+border_color+"&textcolor="+text_color;
document.write("<iframe id='"+my_frame_id+"' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' hspace='0' vspace='0' src='"+mymedsrc+"' width='"+size[0]+"' height='"+size[1]+"'></iframe>");
InitializeTimer()

function InitializeTimer()
{
    secs = 10
    StopTheClock()
    getContent()
}

function StopTheClock()
{
    if(timerRunning)
        clearTimeout(timerID)
    timerRunning = false
}


function getContent()
{
    if (secs==0)
    {
        //StopTheClock()
        //alert("You have just wasted 10 seconds of your life.")
		secs=10
		getContent()
    }
    else
    {
        self.status = secs
        secs = secs - 1
        timerRunning = true
        timerID = self.setTimeout("getContent()", delay)
    }
}
