Note that the following example is used:
<Script language = "JavaScript" type = "text/JavaScript">
Adtime = 8;
Chancead = 1;
VaR NS = (document. layers );
VaR Ie = (document. All );
VaR W3 = (document. getelementbyid &&! IE );
Adcount = 0;
Function initad (){
If (! NS &&! IE &&! W3) return;
If (IE) addiv = eval ('document. All. soraddiv. style ');
Else if (NS) addiv = eval ('document. Layers ["soraddiv"] ');
Else if (W3) addiv = eval ('document. getelementbyid ("soraddiv"). style ');
Randad = math. Ceil (math. Random () * chancead );
If (ie | W3)
Addiv. Visibility = "visible ";
Else
Addiv. Visibility = "show ";
If (randad = 1) showad ();
}
Function showad (){
If (adcount <adtime * 10) {adcount + = 1;
If (IE) {documentwidth = Document. Body. offsetwidth/2 + document. Body. scrollLeft-20;
Export entheight = Document. Body. offsetheight/2 + document. Body. scrollTop-20 ;}
Else if (NS) {documentwidth = Window. innerwidth/2 + window. pageXOffset-20;
Export entheight = Window. innerheight/2 + window. pageYOffset-20 ;}
Else if (W3) {documentwidth = self. innerwidth/2 + window. pageXOffset-20;
Export entheight = self. innerheight/2 + window. pageYOffset-20 ;}
Addiv. Left = documentWidth-100; addiv. Top = documentHeight-0;
SetTimeout ("showad ()", 100 );}
}
Function closead (){
If (ie | W3)
Addiv. Display = "NONE ";
Else
Addiv. Visibility = "hide ";
}
Function $ (OBJ ){
Return document. getelementbyid (OBJ );
}
function checkform () {
if ($ ("file1"). value! = "")
{< br> If (/jpg | JPEG | GIF | BMP/I. test ($ ("file1 "). value. match (/\. (\ W +) $/) [0]) = false) {
alert ("You can only upload image files");
return false;
}< br> else
{< br> return true;
}< BR >}< br> else
{< br> alert ("You have not selected the image to be uploaded");
return false;
}< BR >}< br> package and download a file