<!--
var filenames = new Array();
filenames[ 'contact' ] = 'Kontakt Side';
filenames[ 'thank' ] = 'Takke Side';
filenames[ 'index' ] = 'Hjem Side/Admin Hjem';

filenames[ 'admin' ] = 'Administrator Side';
filenames[ 'comments' ] = 'Tilbakemelding Side';
filenames[ 'newcourse' ] = 'Lag Kurs Side'; 
filenames[ 'editcourse' ] = 'Rediger Kurs Side'; 
filenames[ 'edittemplate' ] = 'Rediger Mal Side'; 
filenames[ 'createuser' ] = 'Lag ny Bruker Side'; 

filenames[ 'login' ] = 'Logg inn Side';
filenames[ 'users' ] = 'Bruker Side';

filenames[ 'viewerror' ] = 'Les Feilmeldinger Side';
filenames[ 'viewtemp' ] = 'Se Midlertidig dokument Side';
filenames[ 'viewuser' ] = 'Se Bruker Side';

function rateit( poptype, popid, popurl ) {
	
	var sitename;
	var strippedurl;
	
	if ( poptype == 'pub' ) {
		strippedurl = 'pub';
	} else if ( poptype == 'unpub' ) {
		strippedurl = 'unpub';
	} else {
		if ( popurl.indexOf( '.' ) != -1 ) {
			strippedurl = popurl.substring( 0, popurl.indexOf( '.' ) );
		} else
			strippedurl = popurl;
	}
	
	var content = '<html>';
		content += '<head>';
			content += '<title>Vurder ' + filenames[ strippedurl ] + '</title>';
			content += '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">';
			
content += '<s' + 'cript type="text/javascript">' + "\n";
content += '<!--' + "\n";

content += 'function submitC( ) {' + "\n";
	content += 'window.rate.comment.value = removeEnti( window.rate.comment.value )' + "\n";
	content += 'window.rate.submit();' + "\n";
content += '}' + "\n";

content += 'function replaceCode( str, from, to ) {' + "\n";
	content += 'newStr = "";' + "\n";
	content += '' + "\n";
	content += 'howfar = 0;' + "\n";
	content += 'while  ( str.indexOf( from, howfar ) != -1 ) {' + "\n";
		content += 'newStr += str.substring( howfar, str.indexOf( from, howfar ) ) + to;' + "\n";
		content += 'howfar = parseInt( str.indexOf( from, howfar )+1 );' + "\n";
	content += '}' + "\n";
	content += 'newStr += str.substring( howfar, str.length );' + "\n";
	content += '' + "\n";
	content += 'return newStr;' + "\n";
content += '}' + "\n";
content += '' + "\n";
content += 'function removeEnti( str ) {' + "\n";
	content += 'str = replaceCode( str, "Ø", "[soo]" );' + "\n";
	content += 'str = replaceCode( str, "ø", "[loo]" );' + "\n";
	content += 'str = replaceCode( str, "Æ", "[sae]" );' + "\n";
	content += 'str = replaceCode( str, "æ", "[lae]" );' + "\n";
	content += 'str = replaceCode( str, "Å", "[saa]" );' + "\n";
	content += 'str = replaceCode( str, "å", "[laa]" );' + "\n";
	content += '' + "\n";
	content += 'return str;' + "\n";
content += '}' + "\n";
content += '//-->' + "\n";
content += '</' + 'script>' + "\n";
		content += '</head>';
	content += '<body>';
		content += '<table cellspacing="0" cellpadding="0" width="100%">';
			content += '<tr>';
				content += '<td style="background-color: #29529C"><table cellspacing="2" cellpadding="3" width="100%">';
					content += '<tr>';
						content += '<td style="background-color: #AFBCD5; text-align: center">';
							content += '<form action="rateit.php" name="rate" enctype="multipart/form-data" method="post">';
								if ( strippedurl == 'pub' || strippedurl == 'unpub' ) {
									content += '<input type="hidden" name="type" value="' + strippedurl + '">';
									content += '<input type="hidden" name="id" value="' + parseInt( popid ) + '">';
								} else {
									content += '<input type="hidden" name="page" value="' + strippedurl + '">';
								}
								content += '<div style="background-color: #29529C; text-align: left; color: #FFFFFF; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; padding: 2px; margin-bottom: 5px;">Gi tilbakemelding</div>';
								content += '<div style="font-family: Verdana; font-size: x-small; padding: 0.3em 0.5em 0.3em 0.5em">';
									content += '<input type="radio" name="rate" value="1">Dårlig';
									content += '<input type="radio" name="rate" value="2">Greit';
									content += '<input type="radio" name="rate" value="3">Bra<br>';
									
									content += '<b>Rask vurdering:</b><br>';
									
									content += '<textarea cols="50" name="comment" rows="2" lang="NO"></textarea><br>';
								content += '</div>';
								
								content += '<div style="background-color: #E2EBFA; padding: 0.3em 0.5em 0.3em 0.5em"><input type="button" onclick="submitC()" value="Send Vurdering"></div>';
							content += '</form>';
						content += '</td>';
					content += '</tr>';
				content += '</table></td>';
			content += '</tr>';
		content += '</table>';
	content += '</html>';
	
	newWindow = window.open( "", "", "height=175,width=500,scrollbars,resizable");
	newWindow.document.write( content );
}


//-->
